Answer the question
In order to leave comments, you need to log in
How to run Python+PhantomJS+Selenium through proxy list?
Good day gentlemen!
In general, there is a code:
from selenium import webdriver
browser=webdriver.PhantomJS()
service_args = [
'--proxy=10.10.20.20:3128',
'--proxy-type=http',
]
browser = webdriver.PhantomJS(service_args=service_args)
browser.get('http://check-host.net/ip')
browser.quit()
Answer the question
In order to leave comments, you need to log in
with open('filename', 'r') as file:
proxy_list = file.readlines()
for proxy in proxy_list:
service_args = [
'--proxy={}'.format(proxy),
'--proxy-type=http',
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question