西西軟件園多重安全檢測(cè)下載網(wǎng)站、值得信賴的軟件下載站!
西西首頁(yè) 電腦軟件 安卓軟件 電腦游戲 安卓游戲 排行榜 專題合集

奇書小說(shuō)目錄爬取表格

  • 奇書小說(shuō)目錄爬取表格
  • 軟件大小:1.1M
  • 更新時(shí)間:2020-07-18 08:39
  • 軟件語(yǔ)言:中文
  • 軟件廠商:
  • 軟件類別:國(guó)產(chǎn)軟件 / 免費(fèi)軟件 / 電子資料
  • 軟件等級(jí):3級(jí)
  • 應(yīng)用平臺(tái):WinXP, Win7, win8
  • 官方網(wǎng)站:暫無(wú)
  • 應(yīng)用備案:
好評(píng):50%
壞評(píng):50%

軟件介紹

奇書小說(shuō)目錄爬取表格,由論壇大佬原創(chuàng)制作分享的一款小說(shuō)目錄爬取表格工具,羅列了奇書小說(shuō)當(dāng)前包含了全部小說(shuō)資源,并且按照分類顯示,每本小說(shuō)都給出了可以在線瀏覽的網(wǎng)頁(yè)鏈接,直接點(diǎn)擊即可跳轉(zhuǎn)到閱讀界面。本次放出奇書小說(shuō)目錄爬取表格資源下載,同時(shí)給出了爬取源碼,想要學(xué)習(xí)參考的朋友們可以看看。

奇書小說(shuō)目錄爬取表格

奇書小說(shuō)目錄爬取表格說(shuō)明

羅列了數(shù)萬(wàn)本已收藏小說(shuō)資源

提供小說(shuō)名,類型,鏈接,作者信息展示

奇書小說(shuō)目錄爬取源碼一覽

#coding=utf-8

import requests

import re

import openpyxl

ld=openpyxl.load_workbook

book=ld("d:\\qishu.xlsx")

sheet1=book["Sheet1"]

hd={'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36'}

p=1

while p<1234:

    url="http://m.iqishu.la/full/"+str(p)+".html"

    try:

        dat=requests.get(url,headers=hd,timeout=60)

    except BaseException:

        dat=requests.get(url,headers=hd,timeout=60)

    if dat.status_code==200:

        with open("d:\\qishu.txt","a+",encoding="utf-8")as f:

            f.write(dat.text)

            f.close()

    else:

        pass

    p=p+1

    print(str(p))

s=open("d:\\qishu.htm",encoding="utf-8").read()

pat=r"<div class=\"full_content\"><p class=\"p1\">(.*?)</p><p class=\"p2\"> <a href=\"(.*?)\" class=\"blue\">(.*?)</a></p><p class=\"p3\"><a>(.*?)</a></p></div>"

r=re.findall(pattern=pat,string=s)

for i in range(len(r)):

    x=r[i]

    print(x)

    row=sheet1.max_row+1

    for b in range(len(x)):

        # print(row)

        sheet1.cell(row,b+1).value=x[b]

book.save("d:\\qishu.xlsx")

其他版本下載

發(fā)表評(píng)論

昵稱:
表情: 高興 可 汗 我不要 害羞 好 下下下 送花 屎 親親
查看所有(0)條評(píng)論 > 字?jǐn)?shù): 0/500

TOP
軟件下載