https://docs.scrapy.org/en/latest/topics/selectors.html#extensions-to-css-selectors 以下の`title`[[属性 (HTML)|属性]]がもつ[[属性値]]を取得したい場合。 ```html <div title="fuga">hoge</div> ``` `::attr(name)`を使って`response.css("div::attr(title)")`のように表現する。 ```python response.css("div::attr(title)").get() ``` > [!caution] > `::attr(name)`は[[CSS]]の仕様としては存在しない。[[Scrapy]]の都合にあわせて独自拡張している。 > > Per W3C standards, CSS selectors do not support selecting text nodes or attribute values. But selecting these is so essential in a web scraping context that Scrapy (parsel) implements a couple of non-standard pseudo-elements: