I finally used the following solution :
$classname="blockProduct";
$finder = new DomXPath($doc);
$spaner = $finder->query("//*[contains(@class, '$classname')]");
More Related Contents:
- How do I get a YouTube video thumbnail from the YouTube API?
- How to get file_get_contents() to work with HTTPS?
- curl POST format for CURLOPT_POSTFIELDS
- How to use cURL to get jSON data and decode the data?
- cURL error 60: SSL certificate: unable to get local issuer certificate
- PHP XML how to output nice format
- Disable warnings when loading non-well-formed HTML by DomDocument (PHP)
- How to parse JSON and access results
- Parse HTML with PHP’s HTML DOMDocument
- PHP cURL vs file_get_contents
- How to get response using cURL in PHP
- CURL ERROR: Recv failure: Connection reset by peer – PHP Curl
- curl error 18 – transfer closed with outstanding read data remaining
- How to enable curl in xampp? [duplicate]
- How to use CURL instead of file_get_contents?
- SFTP from within PHP
- Correct way to set Bearer token with cURL
- Run composer with a PHP script in browser
- How can I send cookies using PHP curl in addition to CURLOPT_COOKIEFILE?
- Send XML data to webservice using php curl
- Is making asynchronous HTTP requests possible with PHP?
- PHP: using DOMDocument whenever I try to write UTF-8 it writes the hexadecimal notation of it
- Laravel 5 Socialite – cURL error 77: error setting certificate verify locations
- DOMDocument PHP Memory Leak
- Saving file using curl and PHP
- Warning: file_get_contents: failed to open stream: Redirection limit reached, aborting
- SSL error can not change to TLS
- CURL import character encoding problem
- Send JSON POST request with PHP
- loadHTML LIBXML_HTML_NOIMPLIED on an html fragment generates incorrect tags