Comments (3)
Unfortunately, pierce
doesn't work the way you hope it would. This could be something interesting to look into though as a default.
from astral.
Thanks for the heads up. I had a look at the Playwright source, but learnt very little. This stack overflow answer helped me though.
Working celestial code:
const doc = await celestial.DOM.getDocument({ depth: 0 })
const frame_node = await celestial.DOM.querySelector({ nodeId: doc.root.nodeId, selector: "iframe#ed-embedded-iframe" })
const frame_description = await celestial.DOM.describeNode({ nodeId: frame_node.nodeId })
const frame_content_remote_object = await celestial.DOM.resolveNode({ backendNodeId: frame_description.node.contentDocument.backendNodeId })
const frame_content_doc = await celestial.DOM.requestNode({ objectId: frame_content_remote_object.object.objectId })
const frame = new ElementHandle(frame_content_doc.nodeId, celestial, page)
await frame.waitForSelector("#ConfirmFee")
Apparently it doesn't work if the iframe's origin is different; security reasons I guess.
It would be a seamless experience if we found a way to query into iframes transparently, but we would have to understand if a query applies to an iframe or not, then modify it to query inside the iframe. It may cause more pain in the long run.
However, if an ElementHandle is on an iframe, then we can forward the querySelector calls to the 'Frame' without too much complexity.
I'd be interested in helping with this project. Are you accepting PRs?
Cheers,
Liam
from astral.
Always happy to accept PRs. I'm curious on how you're thinking about this.
from astral.
Related Issues (20)
- suggestion: allow for transparent backgrounds in screenshots HOT 3
- suggestion: allow for multiple browsers to be run at the same time
- bug: potentially flaky dialog box function
- Questions regarding net navigation HOT 3
- use xdg cache directory instead of home/.astral HOT 1
- add ElementHandle.parentElement HOT 2
- Cannot get Astral to work with `deno test` HOT 2
- Astral can't download a supported browser on ARM linux HOT 2
- `unsafelyGetCelestialBindings` should run `websocketReady`
- Fail to launch browser without write permission HOT 1
- Alternative to `await page.setRequestInterception(true);`? HOT 1
- Configurable tempDir or at least exposing it some how HOT 2
- `page.keyboard.press("Tab")` input "Tab" as text HOT 7
- Publish astral on JSR HOT 4
- request: provide an example of connecting to an existing browser HOT 1
- Evaluating astral for Fresh HOT 3
- `browser.newPage` sometimes fails to detect loaded pages HOT 1
- Export PDF cause `maxAttempts` error HOT 1
- ElementHandle fails to find node by id HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astral.