本文整理汇总了PHP中Crawler::getalllineswhere方法的典型用法代码示例。如果您正苦于以下问题:PHP Crawler::getalllineswhere方法的具体用法?PHP Crawler::getalllineswhere怎么用?PHP Crawler::getalllineswhere使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crawler
的用法示例。
在下文中一共展示了Crawler::getalllineswhere方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
$lines = $c->getalllineswhere('>>');
$c->close();
unset($c);
//echo '$lines:', htmlspecialchars(print_r($lines, true)), '<br />';
flush();
foreach ($lines as $line) {
$bigC++;
if ($bigC >= $fromC) {
$link = Crawler::extract($line, 'href="', '"');
echo 'Opening ', $bigC, ' ', $link, '<br />';
flush();
$c = new Crawler($link);
if ($c->stream) {
$c->go2linewhere('time SG_txtc');
$time = $c->getbetween('>(', ')<');
$blines = $c->getalllineswhere('/orignal/');
$c->close();
unset($c);
//echo '$blines:', htmlspecialchars(print_r($blines, true)),'<br />';
flush();
foreach ($blines as $bline) {
if (strpos($bline, 'url=') === false) {
$blink = Crawler::extract($bline, 'HREF="', '"');
} else {
if (strpos($bline, 'url=') !== false) {
$blink = Crawler::extract($bline, 'url=', '"');
}
}
$blink = str_replace('&690', '', $blink);
echo '<a href="', $blink, '">', $time, "</a><br />\n";
//echo '<a href="', $blink, '">', Crawler::n($bigC, 3), "</a><br />\n";
示例2: flush
require_once "crawler.php";
$istart = 1;
$ifinish = 12;
$start = 'http://photo.blog.sina.com.cn/u/1264425925/page';
$fromC = 0;
extract($_GET);
extract($_POST);
$bigC = 0;
for ($i = $istart; $i <= $ifinish; $i++) {
$bigC = $i * 1000;
$turl = $start . $i;
echo $i, $turl, "<br />\n";
flush();
$c = new Crawler($turl);
if ($c->stream) {
$lines = $c->getalllineswhere('pt_border');
$c->close();
//echo '$lines:', htmlspecialchars(print_r($lines, true)), '<br />';
flush();
foreach ($lines as $line) {
$bigC++;
if ($bigC >= $fromC) {
$link = Crawler::extract($line, '<a href="', '"');
$imgurl = str_replace('photo.blog.sina.com.cn', 'static10.photo.sina.com.cn', $link);
$imgurl = str_replace('/photo/', '/orignal/', $imgurl);
echo "<a href='{$imgurl}'>" . basename($imgurl) . "</a><br/>\n";
}
}
}
flush();
}