Open azurda opened 3 months ago
$ go list -m github.com/chromedp/chromedp github.com/chromedp/chromedp v0.9.5 $ 123.0.6312.87 go version go1.20.5 darwin/arm64
Reproducible file: https://github.com/go-rod/rod/blob/main/fixtures/click-iframe.html
Relevant code section contained in chromedp.ActionFunc :
chromedp.ActionFunc
rootNode, err := dom.GetDocument().WithPierce(true).WithDepth(-1).Do(ctx) if err != nil { return err } htmlSource, err := dom.GetOuterHTML().WithNodeID(rootNode.NodeID).Do(ctx) if err != nil { return err } fmt.Println(htmlSource)
I expected to see the whole DOM including the nested rendered content when using WithPierce(true). I know it is possible to create a context from the iframe target but that would require inserting the content later into the output of GetOuterHTML()
WithPierce(true)
GetOuterHTML()
<html><head><style> iframe { margin: 100px; height: 200px; width: 200px; } </style> </head><body> <iframe src="./click.html"></iframe> <script> function testIsolation() { return 'ok' } testIsolation() </script> </body></html
What versions are you running?
What did you do? Include clear steps.
Reproducible file: https://github.com/go-rod/rod/blob/main/fixtures/click-iframe.html
Relevant code section contained in
chromedp.ActionFunc
:What did you expect to see?
I expected to see the whole DOM including the nested rendered content when using
WithPierce(true)
. I know it is possible to create a context from the iframe target but that would require inserting the content later into the output ofGetOuterHTML()
What did you see instead?