https://docs.scrapy.org/en/latest/topics/selectors.html#extensions-to-css-selectors 以下の`hoge`を取得したい場合。 ```html <div>hoge</div> ``` `::text`を使って`response.css("div::text")`のように表現する。取得したテキストは改行や空白を含む可能性が高いので、[[str.strip]]を使った方がよい。 ```python response.css("div::text").get().strip() ``` > [!caution] > `::text`は[[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: