LoginSignup
1
1

More than 5 years have passed since last update.

PerlでLWPを使って仮想ブラウザを作る

Posted at

perlとLWPがインストールされている状態にて。

perl -MLWP -le "print(LWP->VERSION)"

→ 6.13 (例)

.pl のソースを下記のように実装する。

use LWP 6.13;
my $browser = LWP::UserAgent->new;
my $url = "http://www.yahoo.co.jp";
my $response = $browser->get( $url );
print $response->decoded_content;

.pl を実行すると、Yahoo!のソースコードが標準出力される。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1