我有个大问题!!我需要下载字幕存档,但我所有的努力都没有给我带来成功!!
1我已经用Scrapy登录了
class LoginSpider(scrapy.Spider):
name = 'opensubtitles.org'
start_urls = ['http://www.opensubtitles.org/ru/login/redirect-%7Cru']
def parse(self, response):
return scrapy.FormRequest.from_response(
response,
formdata={'username': 'nothing_interesting_here', 'password': 'brute-force-me'},
callback=self.after_login
)
def after_login(self, response):
# check login succeed before going on
if "authentication failed" in response.body:
self.logger.error("Login failed")
return
2。在我试图下载文件,并有错误403禁止使用
urllib.request.urlretrieve
如果我下载了超过15个文件,而python2只是url.retrive
工作!!你知道吗
urllib.request.urlretrieve('http://dl.opensubtitles.org/en/download/sub/vrf-108d030f/6633065', 'NAMEEEEEEEEEEEE.zip')
我怎样才能解决这个问题?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐