我正在编写一个网络爬虫,我一直在使用 WWW::Mechanize::Firefox 来导航一些页面(对于其他我使用 WWW::Mechanize),这些页面在页面加载后继续加载内容,我从来没有问题。
昨天我在脚本中添加了 DBI 和 DBD::mysql,添加了将数据导出到数据库的查询(这非常有效),但是突然 MozRepl 开始给出这个错误:
(in cleanup) Can't call method "execute" on an undefined value at /Library/Perl/5.10.0/MozRepl.pm line 372 during global destruction.
(in cleanup) Can't call method "execute" on an undefined value at /Library/Perl/5.10.0/MozRepl.pm line 372 during global destruction.
并在 1 个周期后终止脚本(它应该一直运行到到达特定文本文件的末尾,但它不会)。
我没有触及这部分脚本的任何内容(不需要将数据库与这些页面一起使用),至少是自愿的。我检查了文件比较应用程序,但无法解决任何问题。
发布代码可能很棘手,它很长,我不知道问题可能出在哪里。
编辑
有时它也会给出这个错误而不是前一个错误:
(in cleanup) Can't call method "cmd" on an undefined value at /Library/Perl/5.10.0/MozRepl/Client.pm line 186 during global destruction.