diff --git a/main.py b/main.py new file mode 100644 index 0000000..dbf5e54 --- /dev/null +++ b/main.py @@ -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'([^<>]+)',str(name)) + if name: + print(name.group(1))