I am trying to extract product information of beers from a hungarian webshop Spar. My code only seems to work and extract the product names when I don't filter to beers. So in case page_url = ('https://www.spar.hu/onlineshop/') then the code works fine but when trying to use the link below in my code, it extracts nothing. I have also tried using the link for total alcohol category but same as when using the beers one.
The code itself:
import requests
from scrapy import Selector
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36'
}
page_url = ('https://www.spar.hu/onlineshop/alkoholos-italok/sor-cider/c/H8-6/?page=1')
html = requests.get(url = page_url, headers = headers).content
sel = Selector(text = html)
for card in sel.xpath('//div[@class= "productBox"]'):
name = card.xpath('//label[@class="productTitle"]/a/text()').extract()
print(name)