Skip to content
Predicting hotel cancellation
  • AI Chat
  • Code
  • Report
  • import requests
    from bs4 import BeautifulSoup
    # Make a request to the webpage
    url = ''
    response = requests.get(url)
    # Parse the HTML content
    soup = BeautifulSoup(response.content, 'html.parser')
    # Find the product elements and extract information
    products = soup.find_all('div', class_='widgetContent')
    for product in products:
        name = product.find('span', class_='dealTitle').text.strip()
        size = product.find('span', class_='dealDetails').text.strip()
        price = product.find('span', class_='a-price').text.strip()
        # Process the extracted information (e.g., store in a database, print, etc.)
        print('Product:', name)
        print('Size:', size)
        print('Price:', price)