Hi
I have a list of URL in excel sheet ColumnA, I have to open each Url in Internet Explorer,copy the content of that page and paste it in active workbook in each sheet.
please anyone help me to loop through url and copy paste.
I am able open url and there is a data click button not able
Private Sub CommandButton1_Click()
'Dim IE As InternetExplorer
Dim oW As Worksheet: Set oW = ThisWorkbook.Worksheets("Sheet1")
Dim oEleCol As MSHTML.IHTMLElementCollection
Dim oEle As MSHTML.IHTMLElement
Dim btnGo As Object
Set IE = CreateObject("InternetExplorer.Application")
With IE
' Set IE
.Visible = True
'ShowWindow .hwnd, SW_SHOWMAXIMIZED
' Navigate to URL
' Wait for page to be ready
While .Busy
DoEvents 'wait until IE is done loading page.
Wend
'================================
Set objButton = IE.Document.getElementById("h_filetype")
objButton.Value = oW.Range("B2")
.Document.getElementById("Date").Value = oW.Range("B3")
.Document.getElementById("section").Value = oW.Range("B4")
'IE.Document.forms(0).submit
'IE.Document.getElementByTagName("getdata-button").Click
End With
'IE.Document.querySelector("input[src='/common/images/btn-get-data.gif']").Click
Set allInputs = IE.Document.getElementsByTagName("input")
For Each element In allInputs
If element.getAttribute("src") = "/common/images/btn-get-data.gif" Then
element.Click
Exit For
End If
Next element
Bookmarks