generate functionMon, 27 Mar 2023

Посмотреть полное видео в

import requests from bs4 import BeautifulSoup import lxml url = "" headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36'} html = requests.get(url, headers=headers).text soup = BeautifulSoup(html, 'lxml') video_links = [a['href'] for a in soup.find_all('a', {'class': 'watch-button'})] with open('naughtyamericavr.txt', 'w') as f: for link in video_links: f.write(link + '\n')

Questions about programming?Chat with your personal AI assistant