GetElementById not working for HTML Table scrape

mnoah

Board Regular
Joined
Oct 14, 2015
Messages
54
Really stumped here. I've managed to scrape a website's results page (Insurance eligibility) and get some results I want and dump it into my Excel file....except for one.

I've tried numerous variations of the getelementbyid/classname/

This is my current code which isn't working, and yes, I am giving the page time to load:
Code:
sht.Cells(j, 5).value = ie.document.getelementbyid("MevsCoveredServices1_lblTerminationMessage")(0).innertext

I need the correct vba to scrape this page, find the message "COVERAGE WILL END ON 02/29/2016...." and put it in the indicated cell on the worksheet.

FupxC8P.png
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
getElementById should only return 1 element so there's no need for the (0).
 
Last edited:
Upvote 0
Works now, thank you! Confused by the () then because I have it in other areas but it still works. Regardless, thanks again.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
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