摘要: 1. 用requests库和BeautifulSoup库,爬取校园新闻首页新闻的标题、链接、正文。 2. 分析字符串,获取每篇新闻的发布时间,作者,来源,摄影等信息 3. 将其中的发布时间由str转换成datetime类型 阅读全文
posted @ 2018-04-02 22:32 201505060365张木贵 阅读(113) 评论(0) 推荐(0) 编辑
摘要: import requests from bs4 import BeautifulSoup url="http://news.gzcc.cn/html/xiaoyuanxinwen/" res=requests.get(url) res.encoding="utf-8" soup=BeautifulSoup(res.text,'html.parser') # for news in soup... 阅读全文
posted @ 2018-04-02 22:02 201505060365张木贵 阅读(76) 评论(0) 推荐(0) 编辑