节点在 WWW::Mechanize::Chrome 中消失了

问题描述

WWW::Mechanize::Chrome 在调用 ->find_all_links() 等不同的方法时会以某种方式丢失节点

No node with given id found

-32000 at /usr/local/share/perl/5.20.2/Chrome/DevToolsProtocol/Target.pm line 490
Node 447 has gone away in the meantime,Could not resolve at /usr/local/share/perl/5.20.2/WWW/Mechanize/Chrome/Node.pm line 206.
No node with given id found

当我在获取所有链接之前再次执行 $mech->get($url) 时,它可以工作,但我不想每次调用方法时都重新获取 URL,无论如何我们稍后需要提交表单。

>
my $mech = WWW::Mechanize::Chrome->new(
        headless => 1,launch_exe => '/usr/bin/google-chrome',launch_arg => ["--headless","--no-sandBox"],separate_session => 1,);

&parse_content;
sub parse_content  {  
    $mech->get($url);
    my $content = $browser->content;    
    # parse some content
}
  
# $mech->get($url); 
# fetching the links would work when getting the URL again 
# but this is not the way it should work

my @links = $mech->find_all_links();
  

有人可以帮忙吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...