0

请查看这张图片 http://i.stack.imgur.com/ZPJHE.jpg

网站链接:

http://tehparadox.com/forum/newthread.php?do=newthread&f=43 您可以登录: 用户 : bestpal pass : qwerty 这只是一个具有相同功能的随机网站

我想要做的是,我试图弹出“随机问题”,就像我对验证码所做的那样(左侧图片),但“随机问题”(右侧图片)没有我的 ID可以在我的程序中弹出它。

无论如何我可以做些什么来使它工作。

4

1 回答 1

0

给定示例中页面的 html:

...
<label for="humanverify">Please type "Google" in the answer area, without quotations.</label>
...

您可以使用 LINQ 和 WebBrowser 实例中的 HTMLDocument 搜索<label>其“for”属性等于“humanverify”的元素:

Dim htmlDocument = webBrowser1.Document
Dim element = htmlDocument.GetElementsByTagName("label").Cast(Of HtmlElement)().FirstOrDefault(Function(e) e.GetAttribute("for") = "humanverify")

If element IsNot Nothing Then
    Return element.InnerText
End If

未经测试的代码(只是在 C# 中转换了一个草图),但在大多数情况下它对我有用。希望能帮助到你。

于 2013-08-08T02:19:22.173 回答