Reputation: 11
I'm doing some personal data science projects and one of them is to see how often certain songs are played on the radio.
http://www.iheart.com/live/radio-1045-3401/
Looking at the above URL, when I look at page source, no values of interest populate. Not sure why, but when I use inspect element in chrome when I hover over the "Now Playing" header, I can see values for song and artist now playing.
Example:
a class="player-song" href="/artist/rem-3610/songs/-2450662/" title="Losing My Religion" data-reactid=".1hpdfx1l4ow.a.1.0.1.1">Losing My Religion</a
My two questions are:
Upvotes: 0
Views: 333
Reputation: 9846
Most web pages that involve dynamic elements have page elements generated and inserted by Javascript that the browser parses and executes for you. You already guessed this, I suspect, based on the question title.
What you see in the page source is the raw HTML before Javascript kicks in and updates it.
You want a headless browser: a browser without a graphical user interface. This will parse and execute Javascript for you, and update page HTML accordingly.
Here is a full list of headless browsers. Note that you can do this task in any language.
Upvotes: 3