The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
perlのWeb::Scraperみたいな記述で、ページの中からデータを取り出すwebscraper.jsという小さなjavascriptのライブラリに、要素をてきとうに渡したらてきとうにXPathを作って動いてくれるwebscraperp.jsというのを書きました。なんで最後にpをつけたかは思い出せません... ブックマークレットWeb::Scraperのjavascriptバージョンwebscraper.jsと同じように、データを取り出したいページでブックマークレットでwebscraperp.jsを読み込んでFirebugコンソールで使います。 ブックマークレット(Firefox3専用) webscraperp コードwebscraperp.js つかいかた Web::ScraperのSYNOPSISで例としてあげられているebayだとアクセスしたときによって出品されているものが違って
id:miyagawa さんの Web::Scraper で、HTML::TreeBuilder::XPath の代わりに XML::LibXML を使うととても幸せになれそうなので実験してます。XML::LibXML に手を出す前に IRC で「tinyxpath とか htmlcxx とか使って xpath 周りを高速にしたい」とかボヤいてことがありました。そのときに、id:vkgtaro さんや id:tomyhero さんに激しく libxml や XML::LibXML をオススメされました。libxml をオススメしてもらえてなかったら、確実に路頭に迷ってました。以下が、変更したファイルと差分です。http://pub.woremacx.com/Web-Scraper/Scraper.pmhttp://pub.woremacx.com/Web-Scraper/Web-Scrap
The document discusses practical web scraping using the Web::Scraper module in Perl. It provides an example of scraping the current UTC time from a website using regular expressions, then refactors it to use Web::Scraper for a more robust and maintainable approach. Key advantages of Web::Scraper include using CSS selectors and XPath to be less fragile, and proper handling of HTML encoding.Read les
Web::Scraper with filters, and thought about Text filters A developer release of Web::Scraper is pushed to CPAN, with "filters" support. Let me explain how this filters stuff is useful for a bit.Since an early version, Web::Scraper has been having a callback mechanism which is pretty neat, so you can extract "data" out of HTML, not limited to the string.For instance, if you have an HTML
Web::Scraper 0.14 is released along with a couple of neat features.First of all, I incorpolated HTML::Tagset's linkElements hash into '@attr' accessor of elements, so if you do this: $s = scraper { process "a", "links[]" => '@href' }; $s->scrape(URI->new("http://www.example.com/")); because a@href is known to be link elements, they're automatically converted to absoltue URI using http://www.exampl
This is inspired by an email from Renée Bäcker asking how to get content inside javascript tag. Because Web::Scraper's 'TEXT' mapping calls as_text method of HTML::Element, it doesn't get the content inside script and style tag. Here's the code that works. It's kinda clumsy, and it'd be nice if there's much cleaner way to do this: #!/usr/bin/perl # extract Javascript code into 'code' use strict; u
The sbox program encountered an error while processing this request. Please note the time of the error, anything you might have been doing at the time to trigger the problem, and forward the information to this site's Webmaster (webmaster@www.ac.cyberhome.ne.jp).Stat failed. /usr/local/apache2/cgi-bin/~mattn: No such file or directory sbox version 1.10 $Id: sbox.c,v 1.16 2005/12/05 14:58:01 lstein
I'm trying to put some neat cookbook things using Web::Scraper on this journal. They'll eventually be incoropolated into the module document like Web::Scraper::Cookbook, but I'll post here for now since it's easy to update and give a permalink to.The easiest way to keep up with these hacks would be to subscribe to the RSS feed of this journal, or look at my del.icio.us links tagged 'webscraper' (w
Yet another non-informative, useless blog As seen on TV! Scraping websites is usually pretty boring and annoying, but for some reason it always comes back. Tatsuhiko Miyagawa comes to the rescue! His Web::Scraper makes scraping the web easy and fast. Since the documentation is scarce (there are the POD and the slides of a presentation I missed), I'll post this blog entry in which I'll show how to
via Web::Scraper プレゼン@YAPC::EU Web::Scraperにコマンドラインインタフェースが追加されたのでさっそく遊んでみた。お題は、オライリー・ジャパン発行書籍一覧から書籍情報の抽出。簡単杉…。 HTMLソースはこんなん。スクレイピング向きのきれいなソースだね。 ... <table class="booklist" width="100%" cellspacing="0" cellpadding="0" border="0"> <tr class="booklist defaultcolor"> ... </tr> <tr class="up"> <td class="booklistisbn"> <a name="4-87311-094-7" /> 4-87311-094-7 </td> <td class="booklisttitle"><a href="
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く