Answer the question
In order to leave comments, you need to log in
How to parse under the site pages?
Great people of the forum! I welcome you on this day!
For example, let's take the site https://nb-bet.com/Results, below there is a page switcher that loads data into the table using the ASP FormData method.
Parsing Href from the table:
require_once('/phpQuery/phpQuery.php');
echo "<br/>"."<h1>". "Парсинг с сайта HREF"."</h1>"."<br/>";
$url = 'https://nb-bet.com/Results';
$request = curl_init( $url );
$options = array(
CURLOPT_HEADER => false,
CURLOPT_NOBODY => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0',
);
curl_setopt_array( $request, $options );
$result = curl_exec( $request );
curl_close( $request );
$pq=phpQuery::newDocumentHTML($result);
$links = $pq->find('span > .a-dotted-hover');
foreach ($links as $link) {
$pqLink = pq($link); //pq делает объект phpQuery
$href[] = $pqLink->attr('href');
}
phpQuery::unloadDocuments($pq);
Answer the question
In order to leave comments, you need to log in
Apparently, the data is loaded by JavaScript, look for the URL that they use for this.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question