【发布时间】:2022-01-21 17:02:04
【问题描述】:
还有哪些其他方法可以用于元素中的文本?
>>> products.css('h2.entry-title').get()
'<h2 class="entry-title" itemprop="headline"><a href="https://example.com/index.php/2021/12/12/your-20-with-few-clicks-from-stash/" rel="bookmark">Your $20 With Few Clicks From Stash</a></h2>'
但试图获取文本,Your $20 With Fever Clicks From Stash using
products.css('h2.entry-title::text').get()
>>> products.css('h2.entry-title::text').get()
>>>
不工作。有什么建议吗?谢谢。
【问题讨论】:
标签: python web-scraping scrapy