Python爬虫完整代码拿走不谢

慈云数据 2024-03-22 技术支持 65 0

对于新手Python爬虫来说是有点难处的,前期练习的时候可以直接套用模板,这样省时省力还很方便。

使用Python爬取某网站的相关数据,并保存到同目录下Excel。

直接上代码

import re
import urllib.error
import urllib.request
import xlwt
from bs4 import BeautifulSoup
def main():
    baseurl ="http://jshk.com.cn"
    datelist = getDate(baseurl)
    savepath=".\\jshk.xls"
    saveDate(datelist,savepath)
    # askURL("http://jshk.com.cn/")
findlink = re.compile(r'')
findimg = re.compile(r'
微信扫一扫加客服

微信扫一扫加客服

点击启动AI问答
Draggable Icon