Hello. There is the following code:
$ch = curl_init('http://example.com/'); curl_setopt($ch, CURLOPT_USERAGENT, 'S'); curl_exec($ch); curl_close($ch); How to choose, for example, a div with the class 'name', who knows? It is desirable, without using libraries, or with phpQuery. Well, if there is no other way, then let's go with the libraries. I would be grateful for the help!
I tried using phpQuery to do this, but it did not work:
require 'phpQuery.php'; $text = curl_exec($ch); phpQuery::newDocument($text); $new_text = pq('.name'); echo $new_text; phpQuery::unloadDocuments();