2008.7.3  

[備忘録]WWW::MechanizeでのBasic認証の例  

すごく簡単にログインできるし、LWP::UserAgentのサブクラスなのでcredentialsも同じように使える。

メモメモ。

[sourcecode language=”perl”]
#!usr/bin/perl
use strict;
use utf8;
use warnings;
use Encode;
use WWW::Mechanize;
my $mech = new WWW::Mechanize;
my $user_name = "ユーザ名";
my $password = "パスワード";
$mech->credentials(‘ドメイン:ポート番号’,’Auth Test’,$user_name,$password );
$mech->get("表示したいURL");
print $mech->content();
[/sourcecode]

WWW::Mechanize 日本語のリファレンス的なもの
http://digit.que.ne.jp/work/product/document/perldoc/WWW-Mechanize-1.02/Mechanize.html#name

WWW::Mechanize 日本語のリファレンス的なもの その2
http://digit.que.ne.jp/work/wiki.cgi?Perl%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%2fWWW%3a%3aMechanize

WWW::Mechanize 日本語のサンプルプログラム perldoc
http://perldoc.jp/docs/modules/WWW-Mechanize-1.02/Examples.pod

Perl] WWW::MechanizeでBasic/Digest認証で

保護されたページを読む
http://d.hatena.ne.jp/teamikl/20040712

WWW::Mechanize 覚書
http://amt.ty.land.to/OpenNote/WWWMechanize.html

Bot作成講座2 – Perlでさくっとスパムブログを作ってみる  – 後ろを見ろ、後ろを!
http://d.hatena.ne.jp/heilig_zwei/20080503/1209802766

gooブックマークにブックマークするPerlスクリプト - M.C.P.C.
http://blog.dtpwiki.jp/dtp/2007/10/gooperl_a537.html

楽天アフィリエイトの確定レポートを自動取得してタブ区切りテキストに出すスクリプト  - Web屋のネタ帳
http://neta.ywcafe.net/000721.html

perl LWP アップロード Basicn認証  – OZの部屋
http://blog.goo.ne.jp/ozoz-goo/e/d57d5276211d4e893e9203e4257dac50

0 Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2024 Heart Beat | powered by WordPress with Barecity