这只是一段标准的代码,与其他JavaScript网站一起运行良好。这次它无法生成js页面源:
import selenium.webdriver as webdriver
import time, contextlib
url = "http://www.j-league.or.jp/data/view.php?d=j2&t=result&s=02&y=2012&l=E"
with contextlib.closing(webdriver.Firefox()) as driver:
driver.get(url)
time.sleep(2)
print driver.page_source.encode("utf-8")
url
是我正在使用的实际页面收件人。你能看出你是否可以生成网站的真实来源吗?