【问题标题】:Accessing content of the web page after simulating click using ghost.py使用ghost.py模拟点击后访问网页内容
【发布时间】:2013-01-29 11:47:31
【问题描述】:

我正在使用 Ghost.py 模拟单击​​按钮。但无法弄清楚如何获取单击按钮后加载的内容。

from ghost import Ghost

ghost = Ghost(wait_timeout=40)
page, extra_resources = ghost.open("http://www.samsung.com/in/consumer/mobile-phone/mobile-phone/viewall")
#ghost.wait_page_loaded()
n=2;

print type(ghost.click("input#txtViewAll"))

接下来要做什么来获取动态加载的内容?

PS:在google上查过,没有得到答案

提前致谢

【问题讨论】:

    标签: python screen-scraping ghost.py


    【解决方案1】:

    我认为这应该是答案:

    page, resources = ghost.evaluate(
        "document.getElementById('txtViewAll').click();", expect_loading=True)
    

    问候,

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-09
      • 2010-11-10
      • 1970-01-01
      • 1970-01-01
      • 2014-04-03
      • 2015-04-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多