<div class="breadcrumbs">
<div class="container">
<a href="https://www.simple-dress.com/" title="Go to Home Page">Home</a>
<span class="divider"> </span>
<a href="https://www.simple-dress.com/cheap-special-occasion-dresses.html" title="">Special Occasion Dresses</a>
<span class="divider"> </span>
<a href="https://www.simple-dress.com/evening-dresses.html" title="">Evening Dresses</a>
<span class="divider"> </span>
<a href="https://www.simple-dress.com/formal-evening-dresses.html" title="">Formal Evening Dresses</a>
<span class="divider"> </span>
<strong>Deep V-neck Yellow Long Prom Dress Sleeveless Satin Evening Dress</strong>
</div>
我想从容器类中抓取第三个锚,但我无法抓取那个锚点。我使用response.css('.breadcrumbs div.container a').getall()
这个选择器抓取所有锚点,但我只能抓取第一个锚点。我是初学者,需要帮助来抓取所有锚点。
1条答案
按热度按时间vwoqyblh1#
使用XPath表达式非常简单。如果要按位置获取锚:
如果你想通过文本链接获得锚: