Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.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
如何使用VB.net将属性设置为javascript生成的页面?_Javascript_Html_Vb.net_Post - Fatal编程技术网

如何使用VB.net将属性设置为javascript生成的页面?

如何使用VB.net将属性设置为javascript生成的页面?,javascript,html,vb.net,post,Javascript,Html,Vb.net,Post,我发现这个页面是由javascript生成的。因此,我尝试在VB.NET中使用WEBBrowser的getElementByID是无效的,因为下面的页面是由javascript生成的 有人能告诉我如何设置OuterHTML的值吗 我可以看到它有一个元素 <input type="text" size="20" autocomplete="off" id="UserName" name="UserName"... 我发现这个页面是由javascript生成的。因此,我尝试使用getEl

我发现这个页面是由javascript生成的。因此,我尝试在VB.NET中使用WEBBrowser的getElementByID是无效的,因为下面的页面是由javascript生成的

有人能告诉我如何设置OuterHTML的值吗

我可以看到它有一个元素

<input type="text" size="20" autocomplete="off" id="UserName" name="UserName"... 

我发现这个页面是由javascript生成的。因此,我尝试使用getElementByID无法正常工作,因为该页面使用javascript。这毫无意义
getElementById()
是一个JavaScript API。你的意思是页面是由VB生成的吗?我在VB.net中使用WebBrowser对象的getElementByID。但是它没有得到元素,因为页面是用JavaScript编写的。如果您在上面查看源代码,您将看到它都是JavaScript。但当您检查chrome中的元素时,您可以看到OuterHTML结果,我发现这个页面是由javascript生成的。因此,我尝试使用getElementByID无法正常工作,因为该页面使用javascript。这毫无意义
getElementById()
是一个JavaScript API。你的意思是页面是由VB生成的吗?我在VB.net中使用WebBrowser对象的getElementByID。但是它没有得到元素,因为页面是用JavaScript编写的。如果您在上面查看源代码,您将看到它都是JavaScript。但当你检查chrome中的元素时,你可以看到OuterHTML的结果
<input type="password" size="20" autocomplete="off" id="Password" name="Password" 
<button type="button" id="ext-gen32" class=" x-btn-text">Logon</button>
Public Class Form1

    Dim wBro As WebBrowser

 Private Sub dothis()
        wBro = New WebBrowser
        wBro.Navigate("https://oms.itradenetwork.com/2/login/logon.cfm")
        AddHandler wBro.DocumentCompleted, AddressOf Me.wBroComplete
 End Sub

 Private Sub wBroComplete()
        Dim eM1 As HtmlElement
        eM1 = wBro.Document.GetElementById("UserName")
        If eM1 IsNot Nothing Then
            MsgBox("hi")
        End If
 End Sub
End Class