在我的ReactJs应用程序中,我正在使用Axios上载作为multipart / form-data的文件。有没有一种方法可以跟踪文件上传的进度。
答案 0 :(得分:1)
这是方法:
class QuotesSpider(scrapy.Spider):
name = "quotes"
custom_settings = {
'DOWNLOADER_CLIENT_TLS_METHOD' : 'TLSv1.0'
}
def start_requests(self):
urls = [
'https://10.20.106.170/page.aspx'
]
for url in urls:
yield scrapy.Request(url=url, callback=self.parse,
meta={'proxy': 'http://<my_proxy_url>:<my_proxy_port>'},
headers={'Proxy-Authorization': basic_auth_header('<my_id>', '<my_pwd>')})
def parse(self, response):
page = response.url.split("/")[-2]
filename = 'quotes-%s.html' % page
with open(filename, 'wb') as f:
f.write(response.body)
self.log('Saved file %s' % filename)
希望有帮助!