YasserKhalil
Well-Known Member
Hello everyone
I am trying to learn about scraping data and I did half of my target .. There is a list of functions and its description
Depending on class name "linkcell" I could grab functions list properly
but as for description I am confused because the class name related sometimes is "definecell" and the last one in each table "functab" is "definecelllast"
Here's the code
Thanks advanced for help
I am trying to learn about scraping data and I did half of my target .. There is a list of functions and its description
Depending on class name "linkcell" I could grab functions list properly
but as for description I am confused because the class name related sometimes is "definecell" and the last one in each table "functab" is "definecelllast"
Here's the code
Code:
Sub Test()
Dim element As IHTMLElement
Dim elements As IHTMLElementCollection
Dim ie As InternetExplorer
Dim html As HTMLDocument
Dim counter As Long
Dim erow As Long
Set ie = New InternetExplorer
ie.Visible = True
ie.navigate "http://www.excelfunctions.net/vba-functions.html"
Do While ie.readyState <> READYSTATE_COMPLETE
Application.StatusBar = "Loading Web page …"
DoEvents
Loop
Set html = ie.document
Set elements = html.getElementsByClassName("linkcell")
counter = 0
For Each element In elements
erow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Cells(erow, 1) = html.getElementsByClassName("linkcell")(counter).innerText
'Need help at this point
'Cells(erow, 2) = html.getElementsByTagName("href")(counter).innerText
counter = counter + 1
Next element
Application.StatusBar = ""
ie.Quit
MsgBox "Done...", 64
End Sub
Thanks advanced for help