我想在以下链接上废弃一些数据:
我的目标只是在data.frame
. 我不能简单地使用urllib
和urllib2
检索静态数据,因为我需要通过单击按钮来模仿人类:Ghost
或者Selenium
是要走的路。
但是,我真的不明白如何翻译成代码“点击第 2 页”、“点击第 3 页”......以及获取总页数。
我的代码:
from ghost import Ghost
url = "http://www.six-structured-products.com/en/search-find/new-search#search_type=profi&class_category=svsp"
gh = Ghost()
page, resources = gh.open(url)
我被困在那里,不知道放哪个标识符而不是 XXX:
page, resources = ghost.evaluate(
"document.getElementById(XXX).click();", expect_loading=True)
(我也会接受使用的解决方案Selenium
)