请找出我错的地方 400

问题描述

import zipfile,urllib.request,shutil,time

file_name = 'newsdataset.zip'
user_agent = 'Chrome/87.0.4280.88'
headers = {'User-Agent':user_agent}
kaggle_info = {"username":"clanmate","key":"XX"}
data = urllib.parse.urlencode(kaggle_info)
data = data.encode('utf-8')
url = 'https://www.kaggle.com/therohk/india-headlines-news-dataset/download'
req = urllib.request.Request(url,data,headers)


with urllib.request.urlopen(req) as response,open(file_name,'wb') as out_file:
    shutil.copyfileobj(response,out_file)

with zipfile.ZipFile(file_name) as zf:
    zf.extractall(".")

谁能找到我的错误 urlopen 有什么问题,我得到了提升 HTTPError(req.full_url,code,msg,hdrs,fp) urllib.error.HTTPError:HTTP 错误 400:错误请求

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)