HtmlUnit iframe 与 javascript src

发布于 2024-12-09 18:05:41 字数 401 浏览 5 评论 0原文

我正在尝试抓取 Google 关键字工具,但遇到了带有 javascript src 的 iframe 的问题。我以为 HtmlUnit 会自动处理这个问题,但是没有。我在谷歌上搜索并找到一些使用 page.asXml() 的建议,这应该可以解决这个问题,但它对我不起作用。

有没有办法完成这样的任务,或者 HtmlUnit 是不可能的?

这是此类 iframe 的示例:

<iframe src="javascript:''" id="__gwt_historyFrame" tabindex="-1" style="position:absolute;width:0;height:0;border:0"></iframe>

提前致谢

I am trying to scrape Google Keyword Tool and I run into the problem with iframes with javascript src. I thought that HtmlUnit will automaticaly handle this, but no. I was googling around and find some recomendation to use page.asXml() which should solve this problem, but it does not work for me.

Is there even any way how to accomplish such task, or is it impossible with HtmlUnit?

Here is example of such iframe:

<iframe src="javascript:''" id="__gwt_historyFrame" tabindex="-1" style="position:absolute;width:0;height:0;border:0"></iframe>

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

莫相离 2024-12-16 18:05:41

Google 关键字工具使用了大量 AJAX,这可能是问题所在。我能够通过 webkit 与 GWT 进行交互。

The Google Keyword Tool uses a lot of AJAX, which might be the problem. I was able to interact with GWT via webkit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文