I'm trying to scrape a website and do I need to use Javascript. I am using Python 2.7 and Spynner. This is the script:
<a href="javascript://" onclick="TranslationPopUpTestimonialQuery('Language_ALL', '', '5', '10', 'date-of-visit')">6</a>
This is my code in Python:
import spynner
browser = spynner.Browser()
browser.load("http://www.zoover.it/italia/lazio/roma/galileo/hotel")
page1 = browser._get_html()
browser.runjs("TranslationPopUpTestimonialQuery('Language_ALL', '', '8', '10', 'date-of-visit')")
browser.wait_load()
page2 = browser._get_html()
Something does not work as get_html does not give me the desired html page...
This the first url: http://www.zoover.it/italia/lazio/roma/galileo/hotel. I load this page with browser.load() and i get the HTML. After i try to go to page 2 simulating a click with browser.runjs(). I call the javascript on the onClick. Then If i call browser._get_html() another time the HTML is ever the same. Can anyone help me? thanks