chrome-php / chrome

Instrument headless chrome/chromium instances from PHP
MIT License
2.29k stars 278 forks source link

HeadlessChromium\Input\Mouse::find() should support XPath #574

Closed divinity76 closed 11 months ago

divinity76 commented 11 months ago

would be nice if Mouse::find() supported XPath, for example by accepting HeadlessChromium\Dom\Selector\XPathSelector as an argument

My usecase is that XPath support searching by text-content (. and text() ) while CSS does not (notably jQuery-selectors does support searching by text, but i don't think Mouse::find() support jQuery selectors)

(Do keep in mind however, this project still support PHP7.4, meaning we cannot use PHP8's union typehints /yet/ )

divinity76 commented 11 months ago

nevermind, we already have Mouse::findElement() for this, I was unaware.