【发布时间】:2022-02-04 18:02:06
【问题描述】:
当我在浏览器中使用链接 (https://docs.google.com/spreadsheet/ccc?key=XXXXXXXXX&output=csv) 时,一切正常。为什么我使用这个脚本总是出错:
import requests
response = requests.get("https://docs.google.com/spreadsheet/ccc?key=XXXXXXXXX&output=csv")
print(response.content)
b'Error 400 (Bad Request)!!1{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color: #222;padding:15px}body{color:#222;text-align:unset;margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px;} > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}pre{ white-space:pre-wrap;}ins{color:#777;text-decoration:none}img{border:0}@media 屏幕和 (max-width:772px){body{background:none;margin-top :0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left :-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0 %/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media 仅屏幕和 (-web kit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size :100% 100%}}#logo{display:inline-block;height:54px;width:150px}
400. 那\xe2\x80\x99 是一个错误。
服务器无法处理请求,因为它格式错误。不应重试。我们所知道的\xe2\x80\x99s。'
【问题讨论】:
标签: python csv python-requests