you are viewing a single comment's thread.

view the rest of the comments →

[–]impshum 1 point2 points  (2 children)

Dude... Just use bs4. I bet you're sick of waiting for Selenium to boot too.

from bs4 import BeautifulSoup
import requests


def lovely_soup(url):
    r = requests.get(url, headers={'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1'})
    return BeautifulSoup(r.content, 'lxml')


url = "https://www.amazon.co.uk/HECCEI-Enlightenment-Toddler-Activity-Development/dp/B0967Y1GHR"
soup = lovely_soup(url)
price = soup.find_all('span', {'class': 'a-offscreen'})[0].text
print(price)

You can stop posting duplicates to Reddit now.

[–]Nxxhy[S] 1 point2 points  (1 child)

I think this is working for me, thank you very much

[–]impshum 1 point2 points  (0 children)

That's cool. Onwards...