阳光高考爬取、、采用神奇的pandas
import pandas as pds
#用pandas库去访问提取表格,可以访问 requests.get访问不到的数据、很神奇。
for i in range(0,2740,20):
url = 'https://gaokao.chsi.com.cn/sch/search.do?searchType=1&xlcc=bk&start='+str(i)
if (i == 0):
data =pds.read_html(url)[0]
data.to_csv('C:/Users/Administrator/Desktop/高校.csv', sep=',', mode='a',header=None,index=None)
else:
data =pds.read_html(url , skiprows=[0])[0]
data.to_csv('C:/Users/Administrator/Desktop/高校.csv', sep=',', mode='a',header=None,index=None)