小编Ugr*_*oon的帖子

Curl/python 请求绕过 <!-- 禁用 MSIE 和 Chrome 友好错误页面的填充 --> 发送请求

我想使用 curl 或 python 的 requests 模块向网站发送请求,但收到 503

如何在curl或python请求中解决它?

from requests import post

json = {"somedata": "somevalue"}
cookies = {"somecookie": "somevalue"}
headers = {"someheader": "somevalue"}

print(post("https://www.example.com/", cookies=cookies, data=json, headers=headers).text)
Run Code Online (Sandbox Code Playgroud)

输出:

<html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body>
<center><h1>503 Service Temporarily Unavailable</h1></center>
<hr><center>Site</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- …
Run Code Online (Sandbox Code Playgroud)

python curl python-3.x python-requests

5
推荐指数
2
解决办法
3万
查看次数

标签 统计

curl ×1

python ×1

python-3.x ×1

python-requests ×1