2021年3月4日星期四

How to extract span text value in this case for CSS selector?

             <p>                 <span class="name">type:</span> phone                 <span class="name">comment</span>:                 there are 103002 units              </p>  

I want to extract the values of 'phone' and 'there are 103002'. I can get the type and comment:

 response.css('p span.name').getall()  

But how to extract 'phone' and 'there are 103002 units' with the corresponding keys (type & comment)?

https://stackoverflow.com/questions/66485114/how-to-extract-span-text-value-in-this-case-for-css-selector March 05, 2021 at 08:41AM

没有评论:

发表评论