добавил main.py

This commit is contained in:
2026-06-10 18:40:40 +03:00
parent 6156e43bd2
commit b7d3c30c86
+19
View File
@@ -0,0 +1,19 @@
import requests
from bs4 import BeautifulSoup
import re
headers = {
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36'
}
response = requests.get(
'https://online.top-academy.ru/education/ochno',
headers=headers
)
html = response.text
soup = BeautifulSoup(html,'html.parser')
result = soup.find_all("a", class_='styles_container__Yf7Qk')
for el in result:
name = el.find("span")
name = re.search(r'<span>([^<>]+)</span>',str(name))
if name:
print(name.group(1))