VBA: cant extract data on a website in Internet Explorer

baralus

New Member
Joined
Apr 10, 2018
Messages
2
Hi all, I've been trying to extract data on some website inside Internet Explorer. I've been able to do it right with this code on some of the websites that I need to work on. But now i just encountered a problem on this specific website in which I cant extract the data that i need because my code can't seem to see the innerText of that specific elementTag. On this code I even listed all the innerText that the elementTag "td" has, but the data that I need is still missing. As if my code can't read that specific tag. I dont know if the problem is in my code or the website is just secured, if anyone had encountered this kind of problem please help. I'm sorry but I can't share the website because it is private.

Code:
sub OpenBrowser()
Dim IE As New SHDocVw.InternetExplorer
Dim html As MSHTML.HTMLDocument
Dim htmldatas As MSHTML.IHTMLElementCollection
Dim htmldata As MSHTML.IHTMLElement



IE.Visible = True
IE.Navigate "my site"

Do: Loop Until IE.ReadyState = READYSTATE_COMPLETE

Set html = IE.Document

Set htmldatas = html2.getElementsByTagName("td")
For Each htmldata In htmldatas
   Debug.Print htmldata.innerText
Next htmldata


end sub
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Try
Code:
    Set htmldatas = html.body.getElementsByTagName("table")
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top