Hi i want to be able to grab the prices from this site, parse them into ints and then average them. Tried a few ways but keep struggling to parse out the final numbers.
import requests
from bs4 import BeautifulSoup
URL = 'https://www.watchfinder.co.uk/search?q=114060&orderby=AgeNewToOld'
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36'}
page = requests.get(URL, headers=headers)
soup = BeautifulSoup(page.content, 'html.parser')
prices = soup.find_all(class_=('prods_price'))
for price in prices:
price = price.text
print(price)
This gives me:
£9,450
£8,750
£8,450
Is there a way to average them? Sorry guys, thanks!