开发者

Python/Scrapy question: How to get cleaner results?

开发者 https://www.devze.com 2023-03-18 06:54 出处:网络
My task for a project is to data mine a website for specific names. My experience with python isn\'t high. When I scraped all the names, they come out in this format:

My task for a project is to data mine a website for specific names. My experience with python isn't high. When I scraped all the names, they come out in this format:

[u'Bob Joe']开发者_如何学Go

[u'Tim Tom']

[u'Anne Frank']

[u'superman']

How can I clean up these values? What does the 'u' signify? Is my xpath wrong? Would I have to clean it up in a scrapy pipeline (I'd like to avoid this)? I just want the names and not the extra junk around it.


In Python 2, the 'u' prefix indicates that it's a Unicode string. [u'Bob Joe'] is a list containing a Unicode string.

0

精彩评论

暂无评论...
验证码 换一张
取 消