Answers for "scrapy get href"

2

scrapy get current url

def parse(self, response):
   current_url = response.request.url
Posted by: Guest on April-21-2021
1

get href scrapy xpath

# with xpath
//div[@class='image']/a[1]/@href

# using css
Link = response.css('span.title a::attr(href)').getall()
Posted by: Guest on May-05-2020

Python Answers by Framework

Browse Popular Code Answers by Language