M
M
MrRadio_Spy2019-08-11 08:08:36
PHP
MrRadio_Spy, 2019-08-11 08:08:36

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:

spoiler
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);

Please tell me how you can parse hrefs from the 2nd, 3rd, etc. pages?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Israpil Akhmedov, 2019-08-11
@MrRadio_Spy

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 question

Ask a Question

731 491 924 answers to any question