无法为ABP安装爬虫

时间:2015-06-19 19:10:14

标签: python firefox firefox-addon adblock

我在尝试安装abpcrawler(下面的存储库)时遇到错误。

https://github.com/adblockplus/abpcrawler

运行命令时

./run.py -b /usr/bin/firefox urls.txt outputdir

我收到以下错误:

bash-3.2# ./run.py -b /usr/bin/firefox urls.txt outputdir
Communicating with client on port 29922
['/usr/bin/firefox', '--crawler-port', '29922', '-foreground', '-profile', '/tmp/tmpgZYg1r.mozrunner']
Traceback (most recent call last):
  File "./run.py", line 195, in <module>
    run()
  File "./run.py", line 178, in run
    runner.start()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mozrunner/base/browser.py", line 67, in start
    BaseRunner.start(self, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mozrunner/base/runner.py", line 102, in start
    self.process_handler.run(self.timeout, self.output_timeout)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mozprocess/processhandler.py", line 700, in run
    self.proc = self.Process([self.cmd] + self.args, **args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mozprocess/processhandler.py", line 103, in __init__
    universal_newlines, startupinfo, creationflags)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

我错过了什么吗?我安装了Mercurial,并且能够克隆构建工具仓库。

1 个答案:

答案 0 :(得分:2)

从错误消息判断,/usr/bin/firefox无法启动,因为:

  

OSError:[Errno 2]没有这样的文件或目录

ABP Crawler需要安装Firefox,它会自动化Firefox以收集数据。如果实际安装了Firefox,则路径可能是/usr/local/bin/firefox或类似的东西。如果您不确定,可以从命令行运行which firefox