WWW::Mechanize::Firefoxで簡単スクリーンショット

Posted on 5月 19, 2010
Filed Under perl |

WWW::Mechanize::Firefox-すごいな
mozreplと組み合わせてこんなコードで簡単にスクリーンショットがとれる

perl mechanize-firefox.pl "yahoo.co.jp" yahoo.png
とかってやってとれたスクリーンショットはこんな
yahoo

write error: filehandle isn't open at /path/to/MozRepl/Client.pm line 186

とかって出たらFirefoxのmozreplが立ち上がってない。

maximum input buffer length exceeded: 1048576 bytes at /path/to/MozRepl/Client.pm line 186

とかって出たらmozreplとperlスクリプトのtelnetのバッファが足りないようなのでgistにあるbufsizeを大きめにとる

PS: 開いてるFirefoxでとったのでMacBookProの解像度を活かしてサイズは(1899 x 1607)になってるのは自慢です

Comments

4 Responses to “WWW::Mechanize::Firefoxで簡単スクリーンショット”

  1. WWW::Mechanize::Firefoxで簡単スクリーンショット : maaash.jp | PORTFOLIO -POST批評空間- on 6月 4th, 2010 7:02

    […] WWW::Mechanize::Firefoxで簡単スクリーンショット : maaash.jp tweetmeme_url = ‘http://wakabanana.ath.cx/feedposts/618/blogger/’;tweetmeme_source = ‘FaceMovie’; WWW::Mechanize::Firefoxで簡単スクリーンショット : maaash.jp […]

  2. want on 8月 3rd, 2010 17:40

    上記のソースを実行すると以下のようなエラーが出るのですが
    どうすればスクリーンショットが取れるようになるか教えていただけないでしょか?

    C:\>perl c:\mech02.pl “yahoo.co.jp” yahoo.png
    Can’t locate object method “new” via package “WWW::Mechanize::Firefox” (perhaps you forgot to load “WWW::Mechanize::Firefox”?)

    at c:\mech02.pl line 9.

    ↓ここでエラーになります
    my $mech = WWW::Mechanize::Firefox->new( #tab => ‘current’, bufsize => 10 * 1024 * 1024, # 10 MB autoclose => 1,);

  3. mash on 8月 5th, 2010 23:34

    どうでしょう、エラーからは、
    use WWW::Mechanize:*Firefox
    していないか、そのモジュールがインストールされていないようです。確認してみてください。

  4. wholesale hardwood floors Santa Monica on 11月 20th, 2011 2:49

    comment2, cymbalta online no prescription, ygfnck, Online Buy remeron Without A Prescription, 698435, Buy Cheap beloc, =-PP, cheap clomid, xvfzhq, Purchase dilantin Online No Prescription, 38551,

Leave a Reply