Python Requests.get不工作,无法建立新连接

Python Requests.get不工作,无法建立新连接,python,beautifulsoup,python-requests,screen-scraping,Python,Beautifulsoup,Python Requests,Screen Scraping,我正在尝试一个网页抓取。一开始代码是有效的,但后来没有。代码是 import requests import hashlib from bs4 import BeautifulSoup def sha512(x): m = hashlib.sha512(x.encode()) return m.hexdigest() session = requests.Session() session.cookies["user-agent"] = "Mozilla/5.0 (Windo

我正在尝试一个网页抓取。一开始代码是有效的,但后来没有。代码是

import requests
import hashlib
from bs4 import BeautifulSoup

def sha512(x):
    m = hashlib.sha512(x.encode())
    return m.hexdigest()

session = requests.Session()
session.cookies["user-agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36"

r = session.post("https://ringzer0ctf.com/login", data={"username":"myusername","password":"mypass"})
r = session.get("https://ringzeractf.com/challenges/13")

soup = BeautifulSoup(r.text, 'html.parser')
它给出了类似于

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='ringzeractf.com', port=443): Max retries exceeded 
with url: /challenges/13 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x04228490>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
requests.exceptions.ConnectionError:HTTPSConnectionPool(host='ringzeractf.com',port=443):超过最大重试次数
url为:/challenges/13(由NewConnectionError(“:未能建立新连接:[Errno 11001]getaddrinfo失败”)引起)

GET请求中的URL错误。将
ringzeractf
更改为
ringzer0ctf