add P-n to URL automatically, and be able to deal with only 1 page
This commit is contained in:
@@ -45,9 +45,13 @@ function immo_download($db) {
|
||||
|
||||
// get amount of available pages
|
||||
$searchPages = $site->query('//div[@id="pageSelection"]/select');
|
||||
$pages = $searchPages->item(0)->childNodes->length;
|
||||
if($searchPages->length == 0) {
|
||||
$pages=1;
|
||||
} else {
|
||||
$pages = $searchPages->item(0)->childNodes->length;
|
||||
}
|
||||
// create a dynamic url in which the current page number can be set in
|
||||
$queryurldyn = str_replace("/P-1/", "/P-%page%/", $queryurl);
|
||||
$queryurldyn = preg_replace("/\/Suche\//", "/Suche/P-%page%/", $queryurl);
|
||||
|
||||
// loop through available pages
|
||||
for ($page = 1; $page <= $pages; $page++) {
|
||||
|
||||
Reference in New Issue
Block a user