Re: [問題] 關於字串的處理問題

看板Perl作者 (System hacked)時間16年前 (2008/11/16 19:47), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《hazton (hazton)》之銘言: : 我抓了google的網頁然後把第一頁的內容放入$html : 現在我想抓裡面的 : "大約有<b>3,850</b>項結果連結至<b>http://tw.yahoo.com</b>" : 的那個數字3850並把他存入$num裡,請問這該如何做呢@@? Google 的搜尋數字可以用 REST::Google 抓到... use REST::Google; REST::Google->service('http://ajax.googleapis.com/ajax/services/search/web'); REST::Google->http_referer('http://www.google.com/'); my $blogurl = $ARGV[0] or die 'You need to specify URL'; my $res = REST::Google->new(q => "link:$blogurl"); print $res->responseData->{cursor}->{estimatedResultCount}, "\n"; -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.235.132
文章代碼(AID): #1980XEVf (Perl)
討論串 (同標題文章)
文章代碼(AID): #1980XEVf (Perl)