I'm having trouble with my Python Script. All i want to do is to parse a div element with an id value:value and to store all the changed values. The value of this element is generating by javascript. This means that the value of the element is depending on user's input. To be more specific the html element looks like that
<div id="value">...Here the frequently changed value generated by javascript...</div>
My python script is the following:
from bs4 import BeautifulSoup
import urllib
x=urllib.urlopen("http://example.com")
s = x.read()
soup = BeautifulSoup(s)
m = soup.find("div",{"id":"value"})
val = m.text
print val
The result is None but on the webpage the changes are obvious! Please help me to figure it out.
x.getcode()
to make sure you actually download the page (it should return 200).