本文整理汇总了PHP中Crawler::go2lineor方法的典型用法代码示例。如果您正苦于以下问题:PHP Crawler::go2lineor方法的具体用法?PHP Crawler::go2lineor怎么用?PHP Crawler::go2lineor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crawler
的用法示例。
在下文中一共展示了Crawler::go2lineor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<ul>
<li>Kelas X</li>
...
<li>Kelas Y</li>
</ul>
<br />
<li>Judul Matakuliah 2
....
</ol>
*/
$finish = false;
$subfinish = false;
$hasil = array();
$craw->go2linewhere('<ol>');
while (!$finish) {
$craw->go2lineor(array('<li>', '</ol>'));
if ($craw->strpos('</ol>') !== false) {
$finish = true;
} else {
//ambil nama matkul
$matkul = $craw->getbetween('<li>', ' ');
echo "\n\nMatKul: {$matkul}\n";
//debug
$subfinish = false;
$craw->go2linewhere('<ul>');
while (!$subfinish) {
$craw->go2lineor(array('<li>', '</ul>'));
if ($craw->strpos('</ul>') !== false) {
$subfinish = true;
} else {
$link = $craw->getbetween('<a href="', '"');
示例2: Crawler
<?php
require_once "crawler.php";
$start_date = '2009-03-10';
$base_url = 'http://www.dilbert.com';
$middle_url = '/strips/comic/';
extract($_GET);
$selesai = false;
$url = $base_url . $middle_url . $start_date;
while (!$selesai) {
$ada_next = false;
$c = new Crawler($url);
echo "URL is {$url}<br />\n";
flush();
$c->go2lineor(array('STR_Content', 'STR_Prev'));
//echo "go2lineor selesai\n";flush();
if ($c->strpos('STR_Prev') !== false) {
//masih ada next
$ada_next = true;
$url = $base_url . $c->getbetween('<a href="', '"');
$c->go2linewhere('STR_Content');
} else {
$ada_next = false;
$selesai = true;
}
$c->readline();
$img = $c->getbetween('<img src="', '"');
echo "<a href='{$base_url}{$img}'>{$start_date}</a><br />\n";
$start_date = Crawler::extract($url, 'comic/', '/');
$c->close();
echo "Closed\n";