I wanna scrape images from yandex with xpath.
Here's an example link : https://yandex.ru/images/search?from=tabbar&text=B%20E%20N%20N%20Y%20-Benny_Electronic
Here's my xpath, seems to work in chropath extension (if you change the number of the last div it will switch to next image)
//div[@class="serp-list serp-list_type_search serp-list_unique_yes serp-list_rum_yes serp-list_justifier_yes serp-controller__list counter__reqid clearfix i-bem serp-list_js_inited"]/div[1]'
Problem is that response doesn't return anything when I'm using scrapy. Here's my code :
import scrapy
from letmerun.folder_music import Utility
class YandexSpider(scrapy.Spider):
name = 'yandex'
start_urls = Utility.artworks_urls
img_links = []
def parse(self, response):
links = response.xpath('//div[@class="serp-list serp-list_type_search serp-list_unique_yes serp-list_rum_yes serp-list_justifier_yes serp-controller__list counter__reqid clearfix i-bem serp-list_js_inited"]/div[1]')
print(links)