How can I find an image source based on xpath elements including a slash?

Viewed 16

I'm trying to get an image on a remote page based on it's source value containing "/images/".

As an example: https://images-na.ssl-images-amazon.com/images/W/WEBP_402378-T1/images/G/01/kindle/ku/KU-retail-lp_KUPrePaid._CB661222046_.jpg

Because it has the /images/ in the source, this xpath should theoretically work:

@$xpath->query('//*[contains(@src,"/images/")]/@src')[0];

Unfortuantely it doesn't not. I thought it might be an escape issue, but that doesn't seem to work either. What's the trick here?

0 Answers
Related