Python——爬取阳光高考所有高校(本科)

import pandas as pds

for i in range(0,1240,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)

你可能感兴趣的:(Python——爬取阳光高考所有高校(本科))