我需要使用不同的代理来避免被禁止。
我将我的代理人放在proxylist.txt
http://xx.xx.xxx.xxx:port
http://xxx.xxx.xx.xxx:port
http://xx.xx.xxx.xxx:port
http://xxx.xxx.xx.xxx:port
我在 custom_settings
中设置了它class MyClass(scrapy.Spider):
reload(sys)
sys.setdefaultencoding('utf8')
start_time = time.time()
name = 'mySpider'
custom_settings = {
'ROBOTSTXT_OBEY' : 'False',
'RETRY_TIMES' : 10,
'PROXY_LIST' : 'proxylist.txt',
'PROXY_MODE' : 0,
'DOWNLOADER_MIDDLEWARES' : {
'scrapy.downloadermiddlewares.retry.RetryMiddleware': 90,
'scrapy_proxies.RandomProxy': 100,
'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware': 110,
'scrapy_crawlera.CrawleraMiddleware': 600,
'scrapy.contrib.downloadermiddleware.useragent.UserAgentMiddleware': None,
'random_useragent.RandomUserAgentMiddleware': 400
},
}
当我的代理没有密码 时,此版本工作
现在我有每个代理的密码,如何更改密码?
答案 0 :(得分:2)
我回答我自己的问题。
我使用它并且它有效:
select
case t.name when 'numeric' then cast (cast (c.precision as varchar(10)) +')' as varchar(100))
end
from sys.columns c inner JOIN sys.types t ON t.user_type_id =
c.user_type_id
inner join sys.tables tb on tb.name='EX_EMPLOYEE' where c.name =
'B_CODE' and tb.object_id = c.object_id