Python 如何使用ghost.py从iframe获取数据?

Python 如何使用ghost.py从iframe获取数据?,python,iframe,web-scraping,ghost.py,Python,Iframe,Web Scraping,Ghost.py,我正试图用iframe刮取站点,所以当我执行ghost.show() 我正常地看到结果,所以iframe被填充,但在我执行ghost.content 它返回iframe empty,认为这样做是为了安全,但我如何才能获得这些数据? 谢谢你,抱歉你的英语不好。你可以这样进入你的框架: ghost = Ghost() ghost.frame('<your frame name>') g.content # Your frame content g.frame() # ascent

我正试图用iframe刮取站点,所以当我执行
ghost.show()
我正常地看到结果,所以iframe被填充,但在我执行
ghost.content
它返回iframe empty,认为这样做是为了安全,但我如何才能获得这些数据?
谢谢你,抱歉你的英语不好。

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

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

g.content  # Your frame content

g.frame()  # ascent back to root frame
ghost=ghost()
幽灵帧(“”)
g、 内容#您的框架内容
g、 帧()#上升回根帧

谢谢Jeanphix提供了这个很棒的库。你能说一下“”中必须包含什么吗?我的意思是如何获得它的?你现在可以传递iframe
name
属性值或iframe索引。