![](/img/trans.png)
[英]How can I login and download a file with Perl's WWW::Mechanize?
[英]How can I get the frame source with Perl's WWW::Mechanize?
使用WWW :: Mechanize :: Firefox,我可以獲得我訪問過的頁面的來源。 但是,如果頁面包含一個框架,我會得到框架標簽,而不是加載的頁面的實際來源。 Mechanize :: Frames似乎就是我想要的。 有沒有辦法一起使用它們?
這可能是因為你沒有加載幀內容。
$mech->follow_link(tag => "frame"); # open first frame in document
my $src = $mech->content;
要獲得幀HTML源,只需通過->selector()
或->xpath()
獲取該幀,然后使用$frame->{innerHTML}
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.