Created
August 13, 2022 12:05
-
-
Save Tonel/e8795ee1a9089f0d4c6f4957a550b608 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$from = null; | |
$to = null; | |
if (isset($_GET["from"]) && is_numeric($_GET["from"])) { | |
$from = $_GET["from"]; | |
} | |
if (isset($_GET["to"]) && is_numeric($_GET["to"])) { | |
$to = $_GET["to"]; | |
} | |
if (is_null($from) || is_null($to) || $from > $to) { | |
die("Invalid from and to parameters!"); | |
} | |
// scrape only the pagination pages whose number goes | |
// from "$from" to "$to" | |
for ($paginationNumber = $from; $paginationNumber <= $to; $paginationNumber++) { | |
// scraping logic... | |
} | |
// write the data scraped to a database/file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment