Hello,
I am having some issues with data scraping a website table I am interested in. The reason is because one of the links I click on in the process opens a new IE tab. How do I follow the link to the new window via VBA? Current code I have is below.
Thanks,
I am having some issues with data scraping a website table I am interested in. The reason is because one of the links I click on in the process opens a new IE tab. How do I follow the link to the new window via VBA? Current code I have is below.
Code:
Sub Button1_Click()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.navigate ("website")
While ie.readyState <> 4: DoEvents: Wend
ie.document.forms(0).all("SheetContentPlaceHolder_c_search1_btnNextSale").Click
End With
Application.Wait Now + #12:00:01 AM#
ie.document.forms(0).all("SheetContentPlaceHolder_C_searchresults_lbPrint").Click
'This button click opens new window
End Sub
Thanks,