I have got the following code, which is supposed to scrape the table and print the result. I am expecting to get them into a table
County| Shropshire Address| Adams Grammar School, High Street, Newport TF10 7BD etc
but i am getting the following:
CountyShropshire AddressAdams Grammar School, High Street, Newport TF10 7BD TypeBoys Grammar Pupils799
so no speace inside.
what am i missing?
Sub scrapeschools()
Dim ie As New SHDocVw.InternetExplorer
Dim htmldoc As MSHTML.HTMLDocument
Dim htmltable As MSHTML.htmltable
Dim tablerow As MSHTML.IHTMLElement
Dim tablecell As MSHTML.IHTMLElement
Dim tablecol As MSHTML.IHTMLElement
ie.Visible = True
ie.navigate "https://www.11plusguide.com/grammar-school-test-areas/wolverhampton-shropshire-walsall/adams-grammar-school/"
Do While ie.readyState < READYSTATE_COMPLETE Or ie.Busy
Loop
Set htmldoc = ie.document
Set htmltable = htmldoc.getElementsByTagName("table")(0)
For Each tablerow In htmltable.Children
For Each tablecell In tablerow.Children
Debug.Print tablecell.innerText
Next tablecell
Next tablerow
End Sub
