Я хочу l oop поверх списка URL-адресов и распечатать код состояния с помощью запросов
Это мой код
import requests
file = open("urls.txt", "r+")
for urls in file:
list = "https://" + urls
r = requests.get(list)
print(r.status_code)
Это мой urls.txt
login.spotify.com
hrblog.spotify.com
lon.spotify.com
cms-change.spotify.com
upgrade.spotify.com
mydata.spotify.com
spclient.wg.spotify.com
Это ошибка, которую я получаю
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='login.spotify.com%0a', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x03141A30>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))