摘要: import requests from bs4 import BeautifulSoup from datetime import datetime url = "http://news.gzcc.cn/html/xiaoyuanxinwen/" res = requests.get(url); res.encoding = "utf-8" soup = BeautifulSoup(res.... 阅读全文
posted @ 2018-04-04 15:17 172张智恒 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 0.可以新建一个用于练习的html文件,在浏览器中打开。 1.利用requests.get(url)获取网页页面的html文件 import requests newsurl='http://news.gzcc.cn/html/xiaoyuanxinwen/' res = requests.get( 阅读全文
posted @ 2018-04-04 14:59 172张智恒 阅读(85) 评论(0) 推荐(0) 编辑