Trying to parse HTML data from the DOM, when I use Chrome’s Developer Tools I can see that data in the console. When I save the page as HTML locally and search for the targeted data it can’t be found. I’ve done some reading about how the static HTML file is what the browser receives, and how Javascript will render it differently for presentation.

Specific example: Google “nba”, there results include a table at top of the page with all the scheduled games for the day nested inside a <tbody>, if you save this page, the HTML file does not contain a <tbody> tag. Trying to parse this table of games using BeautifulSoup4 with Python.

Answer

To do this completely programmatically, you need to run a headless browser – something that executes JavaScript just like your real browser. Ghost.py can make this easier.

Otherwise you can do as millimoose suggests, and save the current DOM state as HTML by using your browser’s built-in developer tools.