实现爬取一天的天气预报 非常简单的一个小爬虫,利用的也是基本的request.BeautifulSoup.re库,算是简单的上手一个小测试吧 from urllib.request import urlopen from bs4 import BeautifulSoup import re resp=urlopen('http://www.weather.com.cn/weather/101270101.shtml') soup=BeautifulSoup(resp,'html.parser')…
python 爬取历史天气 官网:http://lishi.tianqi.com/luozhuangqu/201802.html # encoding:utf-8 import requests from bs4 import BeautifulSoup import pymysql import pandas as pd date_list = [x.strftime('%Y%m') for x in list(pd.date_range(start='2016-09', end='2018-…