Hello.
I'm trying to develop a web crawler with VBA which helps me download data from the specific webpage , what i want to do is make in VBA to upload a excel file with product numbers and then to crawl , recently i developed a very easy Crawler which is not a lot specific i have the code , and if someone could change it and make it for specific crawler.
I want from this page : 3M 1776 12" X 12"-6/PK 3M (TC) | Tapes, Adhesives, Materials | DigiKey to crawl only the Product Attributes.
Below the Photo is the Code.
Sub CountryPopList()
Dim ieObj As InternetExplorer
Dim htmlEle As IHTMLElement
Dim i As Integer
i = 1
Set ieObj = New InternetExplorer
ieObj.Visible = True
ieObj.navigate "List of countries and dependencies by population - Wikipedia"
Application.Wait Now + TimeValue("00:00:05")
For Each htmlEle In ieObj.document.getelementbyclassname("wikitable")(0).getelementsbytagename("tr")
With ActiveSheet
.Range("A" & i).Value = htmlEle.Children(0).textContent
.Range("B" & i).Value = htmlEle.Children(1).textContent
.Range("C" & i).Value = htmlEle.Children(2).textContent
.Range("D" & i).Value = htmlEle.Children(3).textContent
.Range("E" & i).Value = htmlEle.Children(4).textContent
End With
i = i + 1
Next htmlEle
End Sub
I'm trying to develop a web crawler with VBA which helps me download data from the specific webpage , what i want to do is make in VBA to upload a excel file with product numbers and then to crawl , recently i developed a very easy Crawler which is not a lot specific i have the code , and if someone could change it and make it for specific crawler.
I want from this page : 3M 1776 12" X 12"-6/PK 3M (TC) | Tapes, Adhesives, Materials | DigiKey to crawl only the Product Attributes.
Below the Photo is the Code.
Sub CountryPopList()
Dim ieObj As InternetExplorer
Dim htmlEle As IHTMLElement
Dim i As Integer
i = 1
Set ieObj = New InternetExplorer
ieObj.Visible = True
ieObj.navigate "List of countries and dependencies by population - Wikipedia"
Application.Wait Now + TimeValue("00:00:05")
For Each htmlEle In ieObj.document.getelementbyclassname("wikitable")(0).getelementsbytagename("tr")
With ActiveSheet
.Range("A" & i).Value = htmlEle.Children(0).textContent
.Range("B" & i).Value = htmlEle.Children(1).textContent
.Range("C" & i).Value = htmlEle.Children(2).textContent
.Range("D" & i).Value = htmlEle.Children(3).textContent
.Range("E" & i).Value = htmlEle.Children(4).textContent
End With
i = i + 1
Next htmlEle
End Sub