import requests from bs4 import BeautifulSoup import pandas as pd import matplotlib.pyplot as plt # Function to scrape data from the website def scrape_books(url):     response = requests.get(url)     soup = BeautifulSoup(response.text, 'html.parser')          titles = []     authors = []     prices = []          # Extracting data     for book in soup.find_all('div', class_='book'):         title = book.find('h2').text.strip()         author = book.find('p', class_='author').text.strip()         price = book.find('p', class_='price').text.strip()                  titles.append(title)         authors.append(author)         prices.append(price)          return titles, authors, prices # URL of the website to scrape url = 'https://www.youtube.com/' # Scrape the data titles, authors, prices = scrape_books(url) # Create a DataFrame data = pd.DataFrame({     'Title': titles,     'Author': authors,     'Price': prices }) # Data analysis print("Top 5 Books:") print(data.head()) # Plotting author_counts = data['Author'].value_counts()[:10]  # Top 10 authors author_counts.plot(kind='bar', title='Top 10 Authors') plt.xlabel('Authors') plt.ylabel('Number of Books') plt.xticks(rotation=45, ha='right') plt.tight_layout() plt.show()