PDA

View Full Version : không lấy được link image trong webbrowser



conanroil
22-12-2010, 10:46
mình định dùng web browser để lấy link capcha:

<img width="91" height="24" alt="" src="/CFFileServlet /_cf_captcha/_captcha_img-3562108202013192234.png">

mà khi chạy nó không ra được.e cũng thử 1 số cái khác và thấy dường như khi tìm kiếm nó bỏ qua phần iframe này. mọi người có cách nào khắc phục không giúp e với.

đoạn code của e đây:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim check = WebBrowser1.Document.GetElementsByTagName("img")
For Each item As HtmlElement In check
If item.GetAttribute("width") = "91" And item.GetAttribute("height") = "24" Then
TextBox1.Text = item.GetAttribute("src")
End If
Next
End Sub

còn đây là source của phần cappcha :

<iframe width="91" height="24" frameborder="0" scrolling="no" style="border: 1px solid rgb(102, 102, 102);" hspace="0" vspace="0" marginwidth="0" marginheight="0" framespacing="0" border="0" src="https://img.lehoangcomputer.com/cpt2/">

<html>

<head></head>

<body onload="document.getElementById('a').style.display='block' ;">

<div style="display: block;" id="a">

<img width="91" height="24" alt="" src="/CFFileServlet /_cf_captcha/_captcha_img-3562108202013192234.png">

</div>

</body>

</html>
</iframe>