python,抓取网页数据

抓取一个网页地址后缀为aspx的网页数据
有五万多页,一开始一页页复制了,比较麻烦
后来学了excel和web craper抓取只能抓取首页,可能是隐藏url的缘故
摸索过程中看到很多说python能抓取
您这边能否有办法抓取好的网页数据制成excel表格呢?有偿!
http://dn4.gxcic.net:1141/WebInfo/Person/Person.aspx

img

img


这个是吧

页码加个循环就行了


import requests
import pandas as pd
url='http://dn4.gxcic.net:1141/WebInfo/Person/Person.aspx'
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36'}

res=requests.get(url,headers=headers)
data=pd.read_html(res.text)[2]
data.to_excel(r"e:\123.xlsx",)

img