How can I get the frame source with Perl WWW :: Mechanize?

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, not the actual source of the loaded page. Mechanize :: Frames is what I am looking for. Is there any way to use them together?

+3
source share
2 answers

Perhaps because you are not loading the contents of the frame.

$mech->follow_link(tag => "frame"); # open first frame in document
my $src = $mech->content;
+4
source

To get the frame HTML source, just get that frame via ->selector()or ->xpath(), and then use $frame->{innerHTML}.

+1
source

Source: https://habr.com/ru/post/1732075/


All Articles