摘要:
爬取糗图百科图片 import os # 导入os模块 import requests # 导入爬虫模块 import re # 导入re模块 import time # 导入时间模块 if not os.path.exists(r'糗图百科图片'): # 检查'糗图百科图片'文件夹如果不存在 执行 阅读全文
摘要:
爬取农产品数据http://www.xinfadi.com.cn/priceDetail.html import requests import time for n in range(1,5): url='http://www.xinfadi.com.cn/getPriceData.html' h 阅读全文
摘要:
re模块代码结构 import re res=""" max maxl max2 max """ ret=re.findall('m.*?x',res) print(ret) 返回的是一个列表,内部包含了正则匹配到的所有数据 因为是全局匹配所以 不会匹配到一个相符的就停止 import re res 阅读全文