简体   繁体   English

带有代理列表的Python + Selenium + PhantomJS

[英]Python+Selenium+PhantomJS with proxy list

In my script i used this method for working PhantomJS with proxy: 在我的脚本中,我使用此方法通过代理工作PhantomJS:

service_args = [
    '--proxy=0.0.0.0:3128',
    '--proxy-type=http',
    ]
browser = webdriver.PhantomJS(service_args=service_args)

Please tell me can I use a proxy list ? 请告诉我可以使用代理列表吗? I need that script worked until the PhantomJS will pass through the all proxy in list? 我需要该脚本起作用,直到PhantomJS将通过列表中的所有代理传递? And how to implement that at the idle proxy, he wrote a message and move to the next? 以及如何在空闲代理中实现该功能,他写了一条消息并转到下一个? For example put detain 20 seconds and if there is no response from the proxy to go further. 例如,放置20秒钟,如果代理没有响应,则继续。

Thank you advance 谢谢你提前

前一段时间,我遇到了同样的问题,没有比使用其他代理重新启动浏览器更好的了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM