Search code examples
pythonurllib2urlopen

Problems getting the page source with urlopen


The webplayer on this site http://rockantenne.de/webplayer has a playlist available with all the songs played so far on that day.

When I am in Firefox and press Ctrl-U to see the source code of the page I can see all the songs played. However if I use urllib2.urlopen and then read() it, everything is the same except the songs are left out.

Can anyone tell me what is the problem here?

Thanks


Solution

  • The page uses AJAX to load the songlist asynchronously, from http://www.rockantenne.de/webplayer/xml/livesongcache.xml?82321.

    Load that URL instead, and parse the returned XML yourself.