Answer the question
In order to leave comments, you need to log in
Selenium + python how to work with proxy list?
#when I insert the prox variable instead of ip:port nothing happens if I enclose the variable in quotes, it just sets the variable name in the proxy fields
#Вот пример скрипта
from selenium import webdriver
from selenium.webdriver.common.proxy import *
f = open('proxy.txt')#открываем список прокси
prox=f.readline().splitlines()
myProxy = "host:8080" #когда вставляю переменную prox заместо ip:port ничего не происходит если переменную заключаю в кавычки он просто устанавливает в поля прокси имя переменной
proxy = Proxy({
'proxyType': ProxyType.MANUAL,
'httpProxy': myProxy,
#
#
#
Answer the question
In order to leave comments, you need to log in
The prox
variable contains a list, but you need a string. Specify the desired index, for example:prox = f.readline().splitlines()[0]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question