Chris
Chris

Reputation: 1317

Scrapy to follow links from HTML a data-link (not href)

I've got the following HTML:

<a data-link="/Category/3/?loadpartial=1">Next</a>

If I run my spider, it seems to not use this link (only a href). Is it anyhow possible for Scrapy to follow data-link links as well?

Upvotes: 0

Views: 220

Answers (1)

Thiago Curvelo
Thiago Curvelo

Reputation: 3740

You can get that with a selector like this:

response.css("a[data-link]::attr(data-link)").get()

Upvotes: 2

Related Questions