20 lines
578 B
Python
20 lines
578 B
Python
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))
|