[問題] perl mechanize 問題

作者: gecer (gecer)   2018-02-08 21:35:48
小弟用mechanize 連結url 因此url有兩個frame 第一個frame 輸入input字串後 submit
後 資料會更新第二個frame 小弟想要下載第二個frame 但是open 2nd frame無法連結
html檔如下
url
<frame name="rtop" src="menu.asp" target="rbottom">
<frame name="rbottom" src="home.html" scrolling="auto">
url link 1
<td width=28% align=center><input type="submit" name="act" value="xxx"
class="cbutton">
Code
==============================================================================
#!c:\\perl\\bin
use strict;
use WWW::Mechanize;
my $url = "myurl";
my $Part = 'mykey';
my $outfile1 = "out1.html";
my $mech = WWW::Mechanize->new();
$mech->get($url);
$mech-> follow_link(tag => "frame"); # open first frame in document
$mech-> field ('' => $Part);
$mech-> submit();
$mech-> follow_link(tag => "frame"); # open 2nd frame in document
my $output_page = $mech->content();
open(OUTFILE, ">$outfile1");
print OUTFILE "$output_page";
close(OUTFILE);
==============================================================================

Links booklink

Contact Us: admin [ a t ] ucptt.com