ちょっとHTMLをパースする必要があったので、BeautifulSoupを使ってみました。参考にさせていただいたサイトはこちら。 あかさかランチにっき: BeautifulSoupによるスクレイピングの練習 あかさかランチにっき: 続・BeautifulSoupのスクレイピングの練習 Perl使いのPythonちゃん: BeautifulSoupでHTML解析 Perl使いのPythonちゃん: PythonでGoogleの表示順位を取得 特定タグの抽出 >>> from BeautifulSoup import BeautifulSoup >>> import urllib2 >>> url = 'http://www.crummy.com/software/BeautifulSoup/documentation.html' >>> html = urllib2.urlopen(u
pip install scrapy cat > myspider.py <<EOF import scrapy class BlogSpider(scrapy.Spider): name = 'blogspider' start_urls = ['https://www.zyte.com/blog/'] def parse(self, response): for title in response.css('.oxy-post-title'): yield {'title': title.css('::text').get()} for next_page in response.css('a.next'): yield response.follow(next_page, self.parse)EOF scrapy runspider myspider.py
Today I've been thinking about what to talk in YAPC::EU (and OSCON if they're short of Perl talks, I'm not sure), and came up with a few hours of hacking with web-content scraping module using Domain Specific Languages. 使ってみたよ! #!/usr/local/bin/perl use strict; use warnings; use FindBin::libs; use URI; use Web::Scraper; use Encode; use List::MoreUtils qw/uniq/; my $links = scraper { process 'a.key
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く