РТ
если нужня сотни тысяч, а то и миллионы запросов - забудь про бесплатные.
Size: a a a
РТ
МС
МС
Y
МС
МС
МС
АН
АН
DD
АН
DD
АН
def start_requests(self):
fromdate = date.fromisoformat(getattr(self, 'fromdate', date.today().isoformat()))
todate = date.fromisoformat(getattr(self, 'todate', date.today().isoformat()))
url = "https://ipnew.rbp.eu/Fgsz.Tso.Data.Web/mvc/TsoData/GetFactDailySetList"
day_count = (todate - fromdate).days + 1
for single_date in (fromdate + timedelta(n) for n in range(day_count)):
body = {
тут немного длинный боди с single_date}
body = dumps(body)
filename = self.download_path + 'FactDailySet.Export.{}.xlsx'.format(single_date.isoformat())
yield Request(url=url, body=body, method='POST', callback=self.parse, meta={'filename': filename})
АН
АН
АН
АН
def parse(self, response):
filename = response.meta['filename']
j_data = loads(response.body)['data']
df = pd.DataFrame.from_dict(j_data)
df.to_excel(filename, sheet_name='FactDailySetExport', index=False)
JW
МС
JW