douyi1963
2017-09-12 06:30
采纳率: 0%
浏览 493

Chromedp:如何处理网页上的iframe?

I want to get the HTML source of the iframe present on the webpage. I am using chromedp package with GoLang. How to handle the iframes with chromedp package? The documentation is very less so couldn't find a way.

Links:

chromedp

Google-doc to get more details of my task.

图片转代码服务由CSDN问答提供 功能建议

我想获取网页 。 我在GoLang中使用chromedp软件包。 如何使用chromedp包处理iframe? 文档非常少,所以找不到方法。

链接:

chromedp

Google文档以获取我的任务的更多详细信息。

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dquoj04882 2017-09-21 22:17
    已采纳

    After many attempts, Finally, I found the way and solved my query. You can check my GitHub repository for this query. Thank you. To get the iframe contents we can use Javascript. Way to do it with chromedp is as below,

    cdp.EvaluateAsDevTools("document.getElementById('IFRAME-ID').contentWindow.document.body.outerHTML;", RESULT-BUFFER),
    
    已采纳该答案
    打赏 评论

相关推荐 更多相似问题