最新消息:20210917 已从crifan.com换到crifan.org

【已解决】pyspider中phantomjs中的proxy是什么意思

pyspider crifan 2210浏览 0评论

折腾:

【未解决】pyspider运行出错:FETCH_ERROR HTTP 599 Connection timed out after milliseconds

期间,想要搞清楚,pyspider中的phantomjs,很多帖子提到了proxy,需要去搞清楚什么意思。

phantomjs  proxy

what is phantomjs proxy

关于Selenium+PhantomJS设置HTTP PROXY的问题 · Acefei ‘s One Piece

好像就只是phantomjs加上代理而已

node.js – How do I set proxy in phantomjs – Stack Overflow

Command Line Interface | PhantomJS

“* –proxy=address:port specifies the proxy server to use (e.g. –proxy=192.168.1.42:8080).

* –proxy-type=[http|socks5|none] specifies the type of the proxy server (default is http).

* –proxy-auth specifies the authentication information for the proxy, e.g. –proxy-auth=username:password).”

另外:

phantomjs use specify proxy · Issue #337 · binux/pyspider

中说了:

“phantomjs-proxy is not proxy for phantomjs, it’s address of phantomjs.”

【总结】

对于pyspider来说,phantomjs-proxy参数指的是:

你另外所运行的phantomjs的实例:host:port

比如:

在一个终端中运行:

<code>pyspider phantomjs --port 23450 --auto-restart true
</code>

然后去另外一个终端中运行pyspider:

<code>pyspider -c config.json all
</code>

其中:

config.json

包含了:

<code>"phantomjs-proxy": "127.0.0.1:23450"
</code>

就可以使得:

此处的pyspider在启动时,不另外启动phantomjs了。

而是去在需要用到phantomjs时,去连接本地电脑127.0.0.1的23450端口中的phantomjs去处理,去加载页面了。

而对于phantomjs本身来说:

proxy,指的是代理,比如翻墙的代理,等等。

具体相关设置,可以参考:

Command Line Interface | PhantomJS

中的:

  • –proxy=address:port specifies the proxy server to use (e.g. –proxy=192.168.1.42:8080).

  • –proxy-type=[http|socks5|none] specifies the type of the proxy server (default is http).

  • –proxy-auth specifies the authentication information for the proxy, e.g. –proxy-auth=username:password)

转载请注明:在路上 » 【已解决】pyspider中phantomjs中的proxy是什么意思

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
93 queries in 0.192 seconds, using 23.34MB memory