Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vba .submit方法在尝试登录时不起作用_Vba_Web Scraping - Fatal编程技术网

Vba .submit方法在尝试登录时不起作用

Vba .submit方法在尝试登录时不起作用,vba,web-scraping,Vba,Web Scraping,我试图登录到一个网页以获取一些表,但我的代码无法登录 这是login按钮的inspect元素 <a onclick="OpenWindowAndLogon();" id="lnkLogon" class="fltBtn" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;lnkLogon&quot;, &quot;&quot;, true, &am

我试图登录到一个网页以获取一些表,但我的代码无法登录

这是login按钮的inspect元素

<a onclick="OpenWindowAndLogon();" id="lnkLogon" class="fltBtn" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;lnkLogon&quot;, &quot;&quot;, true, &quot;&quot;, &quot;default.aspx&quot;, false, true))">
                                                                                    <span>Login</span>
'在这里,它不做任何事情,而假设登录到页面'

`.submit`



End Sub

下面显示的是通过将每个元素和按钮的ID作为目标来管理登录过程

Option Explicit
Public Sub Login()
    Dim ie As InternetExplorer
    Set ie = New InternetExplorer
    With ie
        .Visible = True
        .navigate "https://www.teambinder.com/TeamBinder184/Logon/default.aspx"

        While .Busy Or .readyState < 4: DoEvents: Wend

        With .document
            .querySelector("#txtUserId").Value = 8888
            .querySelector("#txtCompanyId").Value = 8888
            .querySelector("#txtPassword").Value = 8888
            .querySelector("#lnkLogon").Click
        End With

        While .Busy Or .readyState < 4: DoEvents: Wend

        Stop                                     '<== Delete me later
        '.Quit '<== Remember to quit application
    End With
End Sub
Option Explicit
Public Sub Login()
    Dim ie As InternetExplorer
    Set ie = New InternetExplorer
    With ie
        .Visible = True
        .navigate "https://www.teambinder.com/TeamBinder184/Logon/default.aspx"

        While .Busy Or .readyState < 4: DoEvents: Wend

        With .document
            .querySelector("#txtUserId").Value = 8888
            .querySelector("#txtCompanyId").Value = 8888
            .querySelector("#txtPassword").Value = 8888
            .querySelector("#lnkLogon").Click
        End With

        While .Busy Or .readyState < 4: DoEvents: Wend

        Stop                                     '<== Delete me later
        '.Quit '<== Remember to quit application
    End With
End Sub