Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

populate VB fields from HTML page (input) 1

Status
Not open for further replies.

lmcate2929

Technical User
Oct 27, 2009
4
US
Can anyone help me I have an HTML that I received and read from and I want to extract 2 variables from the HTML into VB. input

Is ther a function() ??? that I could use.

Thanks,

Sam
 
Are these two pieces of information defined by an element tag? If So you could use DOM and the GetElementsByTagName and then probably followed by the elements innertext property.

The following example uses the webbrowser control only but you should get the idea...

[tt]
Option Explicit

Private Sub Form_Load()
Command1.Enabled = False
Me.Visible = True
WB.Navigate "Do While WB.ReadyState <> READYSTATE_COMPLETE
DoEvents
Loop
Command1.Enabled = True
End Sub

Private Sub Command1_Click()
Dim Images As Object, Image As Object
Set Images = WB.Document.getelementsbytagname("img")
For Each Image In Images
Debug.Print Image.href
Next
End Sub
[/tt]



Good Luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top