When I run this code I do not get an error message but it also does not pull the information that i am looking for. Is there something that I am missing as to why it is not pulling the information. Also please let me know if you need the HTML code as well. Also I am trying to pull the innertext from the ClassName "product-text" that is inside the ClassName "product-text-label" that is inside the classname "product-meta-data" and then innertext is the description on the webpage.
Code:
Sub FillInternetForm()
Dim IE As Object
Dim html As HTMLDocument
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "http://barcodelookup.com"
IE.Visible = True
While IE.Busy
DoEvents 'wait until IE is done loading page.
Wend
IE.document.All("search-input").Value = ThisWorkbook.Sheets("Sheet1").Range("a1").Text
'IE.Document.All("btn btn-danger btn-search").Click
Set btn = IE.document.querySelector("span[class=btn-seach-text]")
btn.Click
Set tags = IE.document.getElementsByTagName("button")
For Each tagx In tags
If tagx.innerText = "Search" Then
tagx.Click
Exit For
End If
Next
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set html = IE.document
Set HoldingsClass = html.getElementsByClassName("product-meta-data")
For Each HoldingClass In HoldingsClass
If InStr(HoldingClass.innerText, "Description") And InStr(HoldingClass.className, "Product-text-label") Then
If InStr(HoldingClass.innerText, "Format") And InStr(HoldingClass.className, "product-text") Then
Sheet1.Cells(2, f).Value = HoldingClass.innerText
Exit For
End If
End If
Next
'Cleanup
IE.Quit
Set IE = Nothing
End Sub
Attachments
Last edited: