import requests from bs4 import BeautifulSoup url = "https://quotes.toscrape.com/" response = requests.get(url) if response.status_code == 200: soup = BeautifulSoup(response.text , 'html.parser') authors_names = soup.find_all('span',class_= 'authors') for author_name in authors_names: print(author_name.get_text()) else: print(f'failed to retrieve the page.status_code:{response.status_code}')
File "<stdin>", line 1 & "C:/Program Files/Python312/python.exe" "c:/Users/Dell/python.py/web scraping.py/test 11.py"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)