怎样用Java代码抓取网页中iframe中的数据

怎样用Java代码抓取网页中iframe中的数据,第1张

你是要抓网页源代码,还是浏览器渲染后的body;

如果是网页源代码,很简单,用java自带的>

间接实现, 先获取iframe页面值到本页面 然后在提交

indexjsp中包含2个frameset

<frameset rows="98," frameborder="no" border="0" framespacing="0">

<frame src="ajsp" name="aFrame" id="aFrame" />

<frame src="bjsp" name="bFrame" id="bFrame" />

</frameset>

<input type="hidden" name="保存a页面的值" value="" />

<script>

var aValue = windowdocumentgetElementById("aFrame")contentWindowdocumentgetElementById("a页面中的元素");

documentgetElementById("保存a页面的值")value = aValue;

然后在提交indexjsp到action

</script>

以上就是关于怎样用Java代码抓取网页中iframe中的数据全部的内容,包括:怎样用Java代码抓取网页中iframe中的数据、如何取得iframe中表单提交后的返回值、struts1 action 中如何获得不同iframe中的数据等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/9633852.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-30
下一篇 2023-04-30

发表评论

登录后才能评论

评论列表(0条)

保存