首页 > 解决方案 > 使用scrapy从类名中获取元素内的文本

问题描述

如何使用scrapy python的类名从以下元素中获取第一个文本,我的意思是“引用到Scrape”?

<div class="col-md-8">
                <h1>
                    <a href="/" style="text-decoration: none">Quotes to Scrape</a>
                </h1>
            </div>

谢谢你的时间。

标签: web-scrapingscrapyweb-crawler

解决方案


这是一个合理的 css 和 xpath 选择器列表。在此处输入图像描述


推荐阅读