當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Crawler::cutafter方法代碼示例

本文整理匯總了PHP中Crawler::cutafter方法的典型用法代碼示例。如果您正苦於以下問題:PHP Crawler::cutafter方法的具體用法?PHP Crawler::cutafter怎麽用?PHP Crawler::cutafter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Crawler的用法示例。


在下文中一共展示了Crawler::cutafter方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: crawl_indowebster

function crawl_indowebster($url)
{
    //echo "'$url'";
    $craw = new Crawler($url);
    $craw->go2lineregexor('/(<\\/div><\\/a><\\/div><\\/div>)/', 1, 'href="#idws7"');
    $setring = $craw->getbetween('location.href=\'', '\'');
    $path = Crawler::extract($setring, 'path=', '&');
    $file_orig = Crawler::cutafter($setring, 'file_orig=');
    $craw->close();
    return '<a href="' . dirname($setring) . '/' . $path . '">' . rawurldecode($file_orig) . '</a>';
}
開發者ID:JerryMaheswara,項目名稱:crawler,代碼行數:11,代碼來源:indowebster.php

示例2: go

 public function go()
 {
     $mark1 = '<a target="_blank" title="Show fullsized image" href=';
     $mark2 = '<a title="Next Image" rel="next" href=';
     $host = 'http://lu.scio.us';
     $finish = false;
     $number = 0;
     $url = $this->url;
     preg_match('/\\/([^\\/]+)\\/page\\/1/', $url, $m);
     $text = $m[1];
     while (!$finish) {
         echo $url . "<br/>\n";
         flush();
         $c = new Crawler($url);
         $c->go_to('id="pid_');
         while ($line = $c->readline()) {
             if (Crawler::is_there($line, 'src="')) {
                 $img = Crawler::extract($line, 'src="', '"');
                 $img = str_replace('thumb_100_', @$_GET['big'] ? '' : 'normal__', $img);
                 $num = Crawler::pad(++$number, 3);
                 $filnm = basename($img);
                 $ext = Crawler::cutafter($filnm, '.');
                 // $text = $num . $ext;
                 // preg_match('/\/(\d+\/\d+)\//', $img, $m);
                 // $text = $m[1];
                 echo "<a href='{$img}'>{$text}</a><br/>\n";
                 flush();
             } else {
                 if (Crawler::is_there($line, '</ul>')) {
                     break;
                 }
             }
         }
         $c->go_to('class="pager"');
         $c->readline();
         if (Crawler::is_there($c->curline, 'Pager_next')) {
             $finish = false;
             $url = $host . Crawler::extract($c->curline, '<a rel="next" href="', '"');
         } else {
             $finish = true;
         }
         $c->close();
     }
 }
開發者ID:JerryMaheswara,項目名稱:crawler,代碼行數:44,代碼來源:spider_luscious.php

示例3: str_replace

echo @$prefix;
?>
"><br />
	<input type="submit">
</form>
<?php 
//http://mangahead.com/Manga-English-Scan/History-Strongest-Disciple-Kenichi/Historys-Strongest-Disciple-Kenichi-392-English-Scan
$sitename = "http://mangahead.com";
$pref = @$_POST['base'];
if (!Crawler::is_there($pref, '/index.php/')) {
    $pref = str_replace($sitename . '/Manga', $sitename . '/index.php/Manga', $pref);
}
if (@$base) {
    $finish = false;
    if (Crawler::is_there($pref, '?page=')) {
        $page = Crawler::cutafter($pref, '?page=');
        $pref = Crawler::cutuntil($pref, '?page=');
    } else {
        $page = 1;
    }
    while (!$finish) {
        echo "{$base}<br/>\n";
        flush();
        $c = new Crawler($base);
        $c->go2linewhere('mangaviewer_toppest_navig');
        if (Crawler::is_there($c->curline, '&nbsp;&nbsp;&rsaquo;')) {
            $finish = false;
            $base = $pref . '/?page=' . ++$page;
        } else {
            $finish = true;
        }
開發者ID:JerryMaheswara,項目名稱:crawler,代碼行數:31,代碼來源:mangahead.php

示例4: back_url

 public static function back_url($full)
 {
     return Crawler::cutafter($full, Crawler::site_name($full));
 }
開發者ID:JerryMaheswara,項目名稱:crawler,代碼行數:4,代碼來源:crawler.php


注:本文中的Crawler::cutafter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。