Having Problems Scraping Multiple Products in Python

Viewed 16

I have a lots of URLs and I want to get the price information of these products. I wrote the code below, but I can only get the price information of the first url.

That's my code:

from lxml import html
import requests

page = requests.get('https://www.avansas.com/uni-ball-umn-207-signo-roller-kalem-0-7-mm-kirmizi-p-80603',
                    'https://www.avansas.com/uni-ball-umn-207-signo-roller-kalem-0-7-mm-siyah-p-8060')
tree = html.fromstring(page.content)

prices = tree.xpath('//*[@id="productDetailStick"]/div/div/div[3]/span/div[2]/span[1]/div/span/span/text()')

prices

What exactly should I do here?

0 Answers
Related