-1

i'm using urllib2 to download the source of a website, but something is going wrong. The source comes from this website: http://www.starfm.com/ All i want to do is to download the entire html , and then parse it extracting the "Now playing" section from the website.

But, when i download the source with this code

response = urllib2.urlopen('http://www.starfm.com/')
html = response.read()
a = open("C:\\users\\Leonardo\\Desktop\\source.txt","w")
a.write(html)
a.close()

the final source does not show the current artist in the website's "Now playing" section.

Why? What should i do?

Thanks so much in advance.

-Leonardo

1 Answers1

0

"now playing" comes from javascript, maybe it loads that info on the onload() event , in this case your code is just reading the content.

maybe this question will help you

Get page generated with Javascript in Python

Community
  • 1
  • 1
Geoffrey-ap
  • 380
  • 3
  • 12