抓取文本容易遇到 一些node , such as <br> \n \t 等空字符,去除方法很多:
way 1 : [i for i in [ i.strip() for i in result] if i !='' ]
way 2 : [ i.strip() for i in result if not i.strip()]
way3 : 引入ItemLoader 模块 ,Mapcompose(unicode.strip())([list])
抓取文本容易遇到 一些node , such as <br> \n \t 等空字符,去除方法很多:
way 1 : [i for i in [ i.strip() for i in result] if i !='' ]
way 2 : [ i.strip() for i in result if not i.strip()]
way3 : 引入ItemLoader 模块 ,Mapcompose(unicode.strip())([list])