[RESOLVED] How to split string(In HTML page)
Hi,
How can i split(Get) value from this tag: NewAccountURL
HTML CODES... <input type="hidden" id="NewAccountURL" value="https://www.google.com/accounts/captcha?ctoken=X_FXnPu9weJb3Akn7Y9_bZmWuKP3MNdslPpg" name="NewAccountURL"> HTML CODES...
Thanks :).
Re: How to split string(In HTML page)
Research on using DOM objects in VB, eg. HTMLDocument object.
Re: How to split string(In HTML page)
1 Attachment(s)
Re: How to split string(In HTML page)
hi,
please open new project and apply following code
add a web browser control in your form (change name: w)
add references Microsoft HTML Object Library
and add 4 Command Button.
Code Here:
vb Code:
Dim WithEvents doc As HTMLDocument
Private Sub Command1_Click()
MsgBox "Element Value : " & vbNewLine & doc.getElementById("NewAccountURL").Value
End Sub
Private Sub Command2_Click()
MsgBox "Element Name : " & vbNewLine & doc.getElementById("NewAccountURL").Name
End Sub
Private Sub Command3_Click()
MsgBox "Element Line : " & vbNewLine & doc.getElementById("NewAccountURL").outerHTML
End Sub
Private Sub Command4_Click()
MsgBox "Element TagName : " & vbNewLine & doc.getElementById("NewAccountURL").tagName
End Sub
Private Sub Command5_Click()
MsgBox "Element Type : " & vbNewLine & doc.getElementById("NewAccountURL").Type
End Sub
Private Sub Form_Load()
w.Navigate App.Path & "\testPage.html"
End Sub
Private Sub w_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
Set doc = w.Document
End Sub
demo project include...
Note: sorry for bad english... :)
Re: How to split string(In HTML page)
Quote:
Originally Posted by RobDog888
Is that your fav thread RobDog? :rolleyes:
Re: How to split string(In HTML page)
Very thanks all :), also KanKi.
Re: How to split string(In HTML page)
Quote:
Originally Posted by lintz
Is that your fav thread RobDog? :rolleyes:
Yes :D It shows at least two different ways to access a webpages source.