31-01-17, 07:21 PM
برجاء الكود التالي لايظهر ال webbrowser اثناء تحميل الصفحه
ممكن تعديله بحيث ارى الصفحه لما تحمل في الفورم وعرض نتيجه msgbox
كود :
Dim objHtml As MSHTML.HTMLDocument
Dim objDoc As MSHTML.HTMLDocument
Dim strUrl As String
Dim col As MSHTML.IHTMLElementCollection
Dim element As MSHTML.HTMLInputElement
' Set to the proper URL
strUrl = "http://vb4arb.com/vb/"
Set objHtml = New HTMLDocument
Set objDoc = objHtml.createDocumentFromUrl(strUrl, vbNullString)
Do While objDoc.ReadyState <> "complete"
DoEvents
Loop
' This block will print out all anchor tags that use the pricen class.
' You can change the tag name and class if you want to return different elements.
Set col = objDoc.getElementsByTagName("ul")
For Each element In col
If element.className = "mymenu" Then
MsgBox element.innerText
'element.Click
End If
Next element
' clean up
Set col = Nothing
Set objDoc = Nothing
Set objHtml = Nothing