Dan George Bostan
Dan George Bostan

Reputation: 13

How to get the Href from the : <a class=''...' href= ''...''> using Scrapy with css selectors

<a class="mod-gallery-article__media mod-gallery-article__media--img has-lightbox"

href="/content/dam/aldi/netherlands/products/nieuw/7089_MIENESTJES_02.png/_jcr_content/renditions/opt.1250w.png.res/1531142854839/opt.1250w.png"

Upvotes: 1

Views: 443

Answers (1)

SuperUser
SuperUser

Reputation: 4822

In [1]: response.css('a::attr(href)').get()
Out[1]: '/content/dam/aldi/netherlands/products/nieuw/7089_MIENESTJES_02.png/_jcr_content/renditions/opt.1250w.png.res/1531142854839/opt.1250w.png'

Upvotes: 2

Related Questions