摘要: # coding=utf-8 import os import chardet import codecs # 批量转换文件夹中的index.shtml为utf-8编码 def run(): # 第一步,读取所有的子文件夹,形成地址列表 all_child_dir = get_all_child_dir("D:\\2") # 第二步,判断路径下的index.shtml... 阅读全文
posted @ 2019-08-25 00:04 胡小易 阅读(522) 评论(0) 推荐(0) 编辑
摘要: # coding=utf-8 import requests import re from bs4 import BeautifulSoup url = 'XXX' r = requests.get(url) r.encoding = 'gb2312' soup = BeautifulSoup(r.text, 'lxml') links = [] for a in soup.find_all(... 阅读全文
posted @ 2019-08-25 00:03 胡小易 阅读(757) 评论(0) 推荐(0) 编辑