gpt4 book ai didi

perl - WWW::Mechanize 中的基本表单方法在 WWW::Mechanize::PhantomJS 中不起作用

转载 作者:行者123 更新时间:2023-12-04 16:21:18 28 4
gpt4 key购买 nike

在 WWW::Mechanize 中使用表单方法

    my @form = $mech->form_number(1);
foreach my $sum_form ( @form ) {
my @inputfields = $sum_form->param;

}

到目前为止工作正常。使用 WWW::Mechanize::PhantomJS,我收到类似的错误
Can't locate object method "param" via package "Selenium::Remote::WebElement" at...

WWW::Mechanize 中的表单方法应该和 WWW::Mechanize::PhantomJS 中的一样吧?有人知道谁来解决这个问题吗?

最佳答案

您应该使用 Data::Dumper 转储此标量,使用下面的代码并粘贴从终端返回的文本。

my @form = $mech->form_number(1);
foreach my $sum_form ( @form ){
use Data::Dumper;
print Dumper $sum_form;
}

关于perl - WWW::Mechanize 中的基本表单方法在 WWW::Mechanize::PhantomJS 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40997485/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com