How do I get javascript results using selenium?
Posted
by Seth
on Stack Overflow
See other posts from Stack Overflow
or by Seth
Published on 2010-03-18T12:17:29Z
Indexed on
2010/03/18
12:41 UTC
Read the original article
Hit count: 308
I have the following code:
from selenium import selenium
selenium = selenium("localhost", 4444, "*chrome", "http://some_site.com/")
selenium.start()
sel = selenium
sel.open("/")
sel.type("ctl00_ContentPlaceHolder1_SuburbTownTextBox", "Adelaide,SA,5000")
sel.click("ctl00_ContentPlaceHolder1_SearchImageButton")
#text = sel.get_body_text()
text = sel.get_html_source()
print(text)
The click executes a javascript file which then produces results on the same page. Obviously print(text)
will only print the orignal html source. How do I get to the results of the javascript?
© Stack Overflow or respective owner