zoukankan      html  css  js  c++  java
  • 阳光高考爬取、、采用神奇的pandas

    阳光高考爬取、、采用神奇的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)

  • 相关阅读:
    Transformer详解
    PAT 1012
    PAT 1011
    PAT 1010
    Jordan Lecture Note-3: 梯度投影法
    PAT 1009
    PAT 1008
    Jordan Lecture Note-2: Maximal Margin Classifier
    PAT 1007
    PAT 1006
  • 原文地址:https://www.cnblogs.com/yuanjia8888/p/11100865.html
Copyright © 2011-2022 走看看