You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fatal error: Uncaught Facebook\WebDriver\Exception\NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"meta[property='og:price:amount']"} (Session info: chrome=122.0.6261.69)
How could the issue be reproduced
//This is the minimum code to reproduce the erro, it is inside a Try yet it raise an exception and halts the page:
try {
// Find the meta tag with the specified OG property
$metaTag = $driver->findElement(WebDriverBy::cssSelector("meta[property='og:price:amount']"));
// Get the content attribute of the meta tag
$price = $metaTag->getAttribute('content');
// terminate the session and close the browser
$driver->quit();
returntrue;
// Output the value
//echo "OG Property '{$ogProperty}' Value: {$ogContent}";
} catch (NoSuchElementException $e) {
// Handle the case when the element is not present
//echo "Element not found. Error: ".$e->getMessage();
returnfalse;
}
### Expected behavior
_No response_
### Php-webdriver version
1.15.1
### PHP version
8.2.0
### How do you start the browser driver or Selenium server
Selenium Docker
### Selenium server / Selenium Docker image version
4.18.1-20240224
### Browser driver (chromedriver/geckodriver...) version
where should I run this?
### Browser name and version
where should I run this?
### Operating system
Ubuntu
### Additional context
The page I'm looking up indeed has this meta set, and I also await for the `<body` tag to load with:
Bug description
Fatal error: Uncaught Facebook\WebDriver\Exception\NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"meta[property='og:price:amount']"} (Session info: chrome=122.0.6261.69)
How could the issue be reproduced
The text was updated successfully, but these errors were encountered: