I want to fetch dynamic content of webpages. I have tried a lot of modules in python as such mechanize, urllib, BS4 and has also used simple_html_dom module in PHP but none of them help me to correctly fetch content of a dynamic page.
I have tried this code:
import urllib2
url = '<url>'
req = urllib2.Request(url)
f = urllib2.urlopen(req)
a = open("E://<url>.html","a")
for x in f:
a.write(str(x))
f.close()
print "succesful fetching"
and then opened in browser without being connected to internet , it didn’t have content which you will get when you are connected to internet. My need is to crawl such dynamic pages and it won't be possible until you have stored the whole actual HTML (that will spawn when URL is opened in some browser) in some variable . This modules is fetching static content.