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

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.

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

1条回答 默认 最新

  • dquoj04882
    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),
    
    点赞 评论

相关推荐