摘要: 使用的是python3.7的环境,解析数据要用xpath,系统是mac pip install lxml一分钟后。。。下载成功 开始写代码, from lxml import etree挂了…,lxml中竟然没有etree模块 换个方法 from lxml import htmlet = html. 阅读全文
posted @ 2020-03-17 17:22 brady-wang 阅读(2968) 评论(0) 推荐(0)
摘要: # -*- coding: utf-8 -*- import re from time import sleep import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import Craw 阅读全文
posted @ 2020-03-17 13:12 brady-wang 阅读(443) 评论(0) 推荐(0)
摘要: 去除数字,特殊字符,只保留汉字 ? 1 2 3 4 5 6 7 8 import re s = '1123*#$ 中abc国' str = re.sub('[a-zA-Z0-9'!"#$%&\'()*+,-./:;<=>?@,。?★、…【】《》?“”‘'![\\]^_`{|}~\s]+', "", 阅读全文
posted @ 2020-03-17 11:48 brady-wang 阅读(22094) 评论(0) 推荐(0)