这段代码在使用firefoxwebdriver时运行得非常好。但对于PhantomJS,它不会单击所需的javascript链接。你知道吗
driver = webdriver.PhantomJS()
driver.get("http://justbet.co.ke/index.php?option=com_justbet&league=1539&Itemid=123")
options = driver.find_elements_by_xpath("//td[@class='optionmore']")
for more in range(0, len(options)):
options[more].click()
sleep(3)
如果选择optionmore类中的a标记,则代码可以工作:
运行上面的代码:
你得到了所有你想要的td数据。你知道吗
相关问题 更多 >
编程相关推荐