简体   繁体   中英

is it possible to retrieve jsp site pagination data using PHP scraping?

i am trying to get pagination data using scraping. next page data are retrieved using on-click event, is it possible to retrieve?

this is my URL which i used for scraping : http://www.esrb.org/ratings/search.jsp

this is the code of next page link :

 <input type="submit" onmousedown="restorePreEdits()" onclick="javascript:scrollPage('1');return false;" id="nextPage" value="&gt;&gt;" name="nextPage">

If you look at the website structure and the Javascript, you would notice that on each click on the next/prev button, the value of the offset input is adjusted from the form below, and then the form is submitted:

<form id="search" action="search.jsp" method="POST">
    .
    .
    .
    <input type="hidden" name="offset" value="50">
    .
    .
    .
</form>

All you need to do for scrapping information from the site is to simulate the submission of this form.

You can refer to this thread on how to send POST requests using cURL and PHP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM