我想从一个在线聊天机器人获得答案。 http://talkingbox.dyndns.org:49495/braintalk? (?在属于链接)使用嵌套帧和javascript的网页抓取
要发送一个问题,你只需要发送一个简单的要求:
http://talkingbox.dyndns.org:49495/in?id=3B9054BC032E53EF691A9A1803040F1C&msg=[Here the question]
来源是这样的:
<frameset cols="*,185" frameborder="no" border="0" framespacing="0">
<frameset rows="100,*,82" frameborder="no" border="0" framespacing="0">
<frame src="http://thebot.de/bt_banner.html" marginwidth="0" name="frtop" scrolling="no" marginheight="0" frameborder="no">
<frame src="out?id=3B9054BC032E53EF691A9A1803040F1C" name="frout" marginwidth="0" marginheight="0">
<frameset rows="100%,*" border="0" framespacing="0" frameborder="no">
<frame src="bt_in?id=3B9054BC032E53EF691A9A1803040F1C" name="frin" scrolling="no" marginwidth="0" marginheight="0" noresize>
<frame src="" name="frempty" marginwidth="0" marginheight="0" scrolling="auto" frameborder="no" >
</frameset>
</frameset>
<frameset frameborder="no" border="0" framespacing="0" rows="82,*">
<frame src="stats?" name="fr1" scrolling="no" marginwidth="0" marginheight="0" frameborder="no">
<frame src="http://thebot.de/bt_rechts.html" name="fr2" scrolling="auto" marginwidth="0" marginheight="0" frameborder="no" >
</frameset>
</frameset>
我所用“机械化”和美丽的网页刮,但我想机械化不支持动态网页。
如何在这种情况下得到答案?
我也在寻找一个在Windows和Linux上运行良好的解决方案。
您可以尝试selenuim,它擅长浏览器自动化以及phantomjs(为无头Webkit提供JS API,Webkit是渲染引擎)的绑定。 http://www.realpython.com/blog/python/headless-selenium-testing-with-python-and-phantomjs/#.UtYORpDtn4w –
什么是动态网页?这些框架只知道http请求,并且您分享的链接不可访问 –
链接已死亡。 –