I want to use XPath to get the href
attribute from an a
-tag, but it has two occurrences within the same file. How am I getting along?
I need to check IF there is an href
attribute with value $street/object, I have got this code and it does not work:
$product_photo = $xpath->query("//a[contains(@href,'{$object_street}fotos/')][1]");
$product_360 = $xpath->query("//a[contains(@href,'{$object_street}360-fotos/')][1]");
$product_blueprint = $xpath->query("//a[contains(@href,'{$object_street}plattegrond/')][1]");
$product_video = $xpath->query("//a[contains(@href,'{$object_street}video/')][1]");
It does not return anything at all. Who can help me out?