3

私は次のコードを持っています:

$IEDocument = $IE->{Document};
$Forms = $IEDocument->all;
$form = $forms->item{'search');
$form->click;

# it clicks the search button which submits to a page
# then I do the following

$doc = $IE->{Document}; #Not sure if correct
$forms = $doc->{DocumentElement}->{InnerHTML};
$form = $forms->item('field');
$form->{value} = "12345";

# The following code must submit to a page, then put new info in an input field on that new submitted page

しかし、それは機能しません、これを行う方法は何ですか?私は多くのことを研究し、誰かがWWW :: Mechanizeの使用を提案しましたが、MechanizeはCMDで何をしているのかを示しているだけで、実際にはブラウザを開かないため、使用するとページのスクリーンショットを撮ることができません。(BTWには、WWW :: Mechanizeを使用してブラウザーを開き、実際に何が起こっているかを確認する方法がありますか?)

4

1 に答える 1

3

その方法について詳しく教えてください

動作しません

スクリーンショットを撮るには、WWW :: Mechanize::Firefoxモジュールを使用できます。

use WWW::Mechanize::Firefox;
my $mech = WWW::Mechanize::Firefox->new();
$mech->get('http://google.com');

my $png = $mech->content_as_png(); #you have a screen in $png now
于 2012-06-30T07:47:44.090 に答える