jeudi 30 avril 2020

Selenium don't read text

I have just started studing selenium. I have this small code into I try to read the price of something in amazon.

    driver = webdriver.Chrome()
    link = "https://www.amazon.it/AMD-Ryzen-5-3600-Processori/dp/B07STGGQ18/ref=sr_1_2? 
    __mk_it_IT=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=amd+ryzen+5&qid=1588259430&sr=8-2"
    driver.get(link)
    price = driver.find_elements_by_id("priceblock_ourprice")
    print(price.text)               
    driver.quit()

But the program say:

    AttributeError: 'list' object has no attribute 'text'

Now i noe that price is a list, but now, how can i take the price from amazon? Thank you




Aucun commentaire:

Enregistrer un commentaire