I am fairly new to web scraping / python and have a block of code which I need a little bit of help with. I can't for the life of me see where I've gone wrong with it. Help as always much appreciated. If you have the time, please highlight where I went wrong!
import requests
from bs4 import BeautifulSoup
import csv
page = requests.get("https://www.bathroomspareparts.co.uk/merlyn-two-panel-hinged-bath-screen-mb7-spare-parts-17909-c.asp")
soup = BeautifulSoup(page.content, 'html.parser')
all_products = []
products = soup.select('div.row cf')
for product in products:
name = product.select('div.item-short-description')[0].text.strip()
price = product.select('div.item-price')[0].text.strip()
all_products.append({
"Name": name,
"Price": price,
})