lino-levan / astral

A high-level puppeteer/playwright-like library for Deno
https://jsr.io/@astral/astral
MIT License
177 stars 7 forks source link

XPath support #12

Open Lco4eDb2 opened 10 months ago

Lco4eDb2 commented 10 months ago

Support for finding elements by XPath?

lino-levan commented 10 months ago

Makes sense to me. Was waiting for someone to ask to implement this.

lino-levan commented 9 months ago

This isn't particularly challenging but it is making me rethink the API. Puppeteer and Playwright have entirely different APIs on this front. I tend to air towards Playwright when that happens but I've already started down a path which is closer to Puppeteer. This would probably require a breaking change to fix.

This is to say: I haven't forgotten this issue! It's just not super clear how to approach.

Lco4eDb2 commented 5 months ago

have you made any progress on this one? also, do you need any help with it?

lino-levan commented 5 months ago

Unfortunately, I have not. This needs to be a breaking change to align us with playwright. If you'd like to pick it up, feel free!

pixeleet commented 3 weeks ago

So umm, can we just use document.evaluate here? What would the implementation in the astral universe look like?

https://developer.mozilla.org/en-US/docs/Web/API/Document/evaluate

lino-levan commented 3 weeks ago

Internally, yep. That's exactly what puppeteer does iirc.