Using WWW::Mechanize::Firefox, I can get the source of the page I visited. However, if the page contains a frame, I get the frame tag and开发者_开发知识库 not the actual source of the page that is loaded. Mechanize::Frames seems to be what I am looking for. Is there a way to use them together?
That's probably because you're not loading the frame contents.
$mech->follow_link(tag => "frame"); # open first frame in document
my $src = $mech->content;
To get at the frame HTML source, just get that frame through ->selector()
or ->xpath()
and then use $frame->{innerHTML}
.
精彩评论