我想抓取的网站有多个动态加载的页面,我想模拟点击(没有像selenium那样打开浏览器),所以我使用鬼.py. 在
这是一个简单的程序
from ghost import Ghost
import time
ghost = Ghost(wait_timeout=50)
page, extra_resources = ghost.open("http://www.samsung.com/in/consumer/mobile-phone/mobile-phone/viewall")
#ghost.wait_page_loaded()
n=2;
#links=ghost.evaluate("""
# alist=document.getElementsById('txtViewAll');
# alist.click;
# """)
#print type(ghost.click("input#txtViewAll"))
page1, resources = ghost.evaluate("document.getElementById('txtViewAll').click();", expect_loading=True)
time.sleep(20)
print page1
但是
输出为无。在
有人能帮我解释一下程序出了什么问题吗。在
为什么不起作用?在
目前没有回答
相关问题 更多 >
编程相关推荐