-1

我正在尝试使用 iframe 抓取网站,所以当我ghost.show() 看到我的结果时,我通常会看到我的结果,所以 iframe 已被填充,但是当我这样做后ghost.content 它返回 iframe 为空,认为它是为了安全而完成的,但我怎样才能获得这些数据?谢谢你,抱歉英语不好。

4

1 回答 1

2

你可以这样进入你的框架:

ghost = Ghost()
ghost.frame('<your frame name>')

g.content  # Your frame content

g.frame()  # ascent back to root frame

http://ghost-py.readthedocs.org/en/latest/#ghost.Ghost.frame

于 2015-01-10T08:03:04.850 回答