forked from zzjzz9266a/91porn_php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path91all.php
executable file
·38 lines (31 loc) · 940 Bytes
/
91all.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require 'detailPage.php';
use DiDom\Document;
use DiDom\Query;
function listPage($baseUrl)
{
$currentPage = 1;
$maxPage = 10; //自行更改页数
while ($currentPage <= $maxPage) {
$url = $baseUrl."&page=".$currentPage;
echo "\n".$url."\n";
try {
$html = getHtml($url);
$listPage = new Document($html);
$list = $listPage->find('//*[@class="listchannel"]/a[1]', Query::TYPE_XPATH);
foreach ($list as $item) {
$title = $item->getAttribute('title');
echo "\n".$title."\n";
$itemUrl = $item->getAttribute('href');
echo $itemUrl."\n";
singlePage($itemUrl, $title);
}
} catch (Exception $e) {
echo $e;
}
$currentPage += 1;
}
}
listPage("http://91porn.com/v.php?category=top&viewtype=basic"); //本月最热
// listPage("http://91porn.com/v.php?category=mf&viewtype=basic"); //收藏最多
// listPage("http://91porn.com/v.php?category=md&viewtype=basic"); //本月讨论