lab3/HTTP/http_requests.py

12 lines
281 B
Python

import requests
url = "http://vyatsu.ru"
response = requests.get(url)
print("Статус-код:", response.status_code)
print("Заголовки ответа:")
print(response.headers)
print("\nПервые 500 символов страницы:")
print(response.text[:500])