经过一些更详细,更广泛的研究后,我找到了一个办法。这是我如何实现的。
<?php
require_once("phpQuery.php");
$min = isset($_GET['min']) ? $_GET['min'] : 1;
$max = isset($_GET['max']) ? $_GET['max'] : 2;
$pages = [];
foreach(range($min, $max) as $page) {
array_push($pages, iconv("CP1251", "UTF-8", file_get_contents("http://www.fayloobmennik.net/files/list/" . $page . ".html")));
}
$html = file_get_html("http://www.fayloobmennik.net/files/list/");
$elem = $html->find('div[id=info] table > tbody', 0);
$test = $elem->find('tr a');
foreach ($test as $test2) {
$regex = '/<a href=\"([^\"]*)\">(.*)<\/a>/iU';
$test2 = preg_match($regex, $test2, $match);
print_r(iconv("CP1251", "UTF-8", $match[2]));
echo "<br/>";
}
?>
phpQuery.php类是simple_html_dom(我相信这就是它的名字?)。
干杯。
在您的问题中包含源代码 – Sievajet 2015-02-17 22:10:30
这是一个文件共享网站。 – 2015-02-17 22:12:50
[你如何在PHP中解析和处理HTML/XML?](http://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html-xml-in-php ) – HamZa 2015-02-17 22:16:03