Skip to content
masterclass Buddy

Scrapy · Method

response.xpath

response.xpath() selects parts of a Scrapy response with XPath. Use .get() to read the first match, and test expressions in the Scrapy shell before using them in a spider.

Last updated

Syntax

response.xpath(xpath)
scrapy shell <url>

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • scrapy.shell
  • scrapy.shell.inspect_response
  • Selector
  • CSS selectors
  • fetch
  • view

Source: Scrapy shell — Scrapy 2.19.0 documentation. Checked 2026-11-03.