【发布时间】:2014-06-26 12:45:12
【问题描述】:
我要做的是抓取网页“http://www.trulia.com/property/1080560259-2-Penelope-Ln-Middletown-NJ-07748”。 In this when the tab Estimates (below Comparable and Estimates section) is selected the data below the google map is loaded dynamically. 此数据在页面源中不可见,但同时在开发者工具窗口(上下文菜单、检查元素)中可见。
我正在使用 Selenium 和 Python 2.7。有没有办法访问这些数据?或者有什么方法可以访问所有元素?
提前致谢。
【问题讨论】:
-
查看我对更大范围问题的回答,从最新的代码清单开始,查看
browser.page_source。答案是stackoverflow.com/questions/23386855/… -
谢谢。但这并不能解决我的问题。有没有办法访问开发工具窗口中列出的元素。生成的动态数据在页面源中不可见。我无法使用响应包,因为我没有新的 URL。默认情况下,Tab 1(可比较)数据来自源。我需要选项卡 2(估计)表数据。
-
我需要的数据在 Dev Tools 窗口的 Elements 部分可见,但在源代码中不可见。
标签: python selenium web-scraping beautifulsoup