Selenium便利なんだけど、ブラウザ立ちあげないといけないのはサーバーで使いにくくて不便だよなと思っていたのだけどPhantomJS使えることを知ったので早速遊んでた。なにやりたいかというとGoogle Patent Searchから特許ID抜き出したいのだけど、Python+Selenium+PhantomJSの組み合わせでできることがわかった。 from selenium import webdriver import time driver = webdriver.PhantomJS() driver.get("https://www.google.co.jp/webhp?hl=ja&tab=ww&authuser=0#authuser=0&hl=ja&q=python") print driver.current_url time.sleep(2) driver.save_sc
今日はスクレイピングの話をします。 今回のターゲットは三菱東京UFJダイレクト。金融機関もウェブサービスを提供するようになり、金にまつわる情報を電子化しやすくなりましたが、かれらが API を提供しているわけではないので、私たちのほうで取得・加工をしてやる必要があります。今やウェブサイトであれば当然のように JavaScript を使っているわけなので、いわゆる mechanize、つまり HTML の解釈をおこない、リンクのクリックやフォームの送信をシンプルに実装するようなやり方でのスクレイピングはすでに無理筋だといえます。 もちろん今日においてはブラウザオートメーションという方法がすでにありますので、これを利用してやれば、なんの憂いもなく実際に人間が使うようなブラウザをプログラマティックに操作することができます。現在は Selenium WebDriver がデファクトで、これが使用す
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く