pyspider+PhantomJS的代

发布时间:2019-05-16 21:54:43编辑:auto阅读(2594)

    环境:pyspider0.3.9 PhantomJS2.1.1,均为最新版

    进程用supervisor托管的。

    其中需要加的几个地方:

    webui进程:

    pyspider -c config.json --phantomjs-proxy=127.0.0.1:25555 webui

    processor进程:

    pyspider -c config.json --phantomjs-proxy=127.0.0.1:25555 processor

    fetcher进程:

    pyspider -c config.json --phantomjs-proxy=127.0.0.1:25555 fetcher

    phantomjs进程:

    pyspider -c config.json phantomjs -- --proxy=ip:port --proxy-auth=name:password

     

    以上需要注意的是,webui、processor 、fetcher 都加了phantomjs的本地地址支持。

    phantomjs 进程后面设置phantomjs 的代理端口,文中的加了验证,免密的可以直接写 -- --proxy=ip:port 不写--proxy-auth=name:password

    ------------------------------

    遇到这个提示,应该可以忽略不计,意思是提示你,任务里面的代理设置并不会影响phantomjs

    phantomjs does not support specify proxy from script, use phantomjs args instead

     

关键字