国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

獲取免費小說,免費小說隨時看

2020-05-28 22:35 作者:每日一遍__以防抑郁  | 我要投稿

很多時候我們追小說時候,總會有很多的廣告,讓我們看小說的心情大打折扣,下面讓我們來獲取免費小說,獲取到本地隨時可以看吧。

import requests,re,parsel

from fake_useragent import UserAgent


ua = UserAgent()

header = {"User-Agent":ua.random}


Url = "https://www.167k.com/book/20761"


session = requests.session()

session.headers = header


def local(url,title,num):

? ? try:

? ? ? ? res = session.get(url)

? ? ? ? if res.status_code == 200:

? ? ? ? ? ? url = "https://www.167k.com/phone/book/get_bookcontent?book_id={}&chapter_id={}".format(num[2], num[3])

? ? ? ? ? ? res = session.get(url)

? ? ? ? ? ? print(res.text)

? ? except Exception as e:

? ? ? ? print("詳細頁面請求出錯:",e)


def main():

? ? try:

? ? ? ? res = requests.get(Url,headers=header)

? ? ? ? # 獲取總標題 和一個圖片

? ? ? ? if res.status_code == 200:

? ? ? ? ? ? html = parsel.Selector(res.text)

? ? ? ? ? ? image = html.xpath('//div[@class="de_navtu"]/div[1]/img/@src').extract_first()

? ? ? ? ? ? # 留意一下這里標題是否有作者名字

? ? ? ? ? ? title_all = html.xpath('//div[@class="de_navtu"]/div[2]/div[1]/text()').extract_first()

? ? ? ? ? ? name = html.xpath('//div[@class="de_navtu"]/div[2]/div[1]/span/text()').extract_first()

? ? ? ? ? ? title_all = title_all.replace("\n","").replace("\t","")

? ? ? ? ? ? mold = html.xpath('//div[@class="de_navtu"]/div[2]/div[2]/div/text()').extract()

? ? ? ? ? ? # print(mold)

? ? ? ? ? ? # print("圖片鏈接:",image)

? ? ? ? ? ? # print("總標題:",title_all)

? ? ? ? ? ? # print("作者:",name,len(name))

? ? ? ? ? ? # print(title_all,len(title_all))

? ? ? ? ? ? titles = html.xpath('//div[@class="bo_zj"]/ul/li/a/@title').extract()

? ? ? ? ? ? urls = html.xpath('//div[@class="bo_zj"]/ul/li/a/@href').extract()

? ? ? ? ? ? for title,url in zip(titles,urls):

? ? ? ? ? ? ? ? #? https://www.167k.com/book/20761/126590035? ? ?構(gòu)造這個URL

? ? ? ? ? ? ? ? #? https://www.167k.com/phone/book/get_bookcontent?book_id=20761&chapter_id=126590035

? ? ? ? ? ? ? ? #? https://www.167k.com/phone/book/get_bookcontent?book_id=20761&chapter_id=126590117

? ? ? ? ? ? ? ? if url == '/book/20761/126590007':

? ? ? ? ? ? ? ? ? ? num = url.split('/')

? ? ? ? ? ? ? ? ? ? url = "https://www.167k.com{}".format(url)

? ? ? ? ? ? ? ? ? ? local(url,title,num)

? ? ? ? ? ? ? ? ? ? print(url)

? ? ? ? ? ? ? ? # url = "https://www.167k.com{}".format(url)

? ? ? ? ? ? ? ? # print(title,url)

? ? ? ? else:

? ? ? ? ? ? print("不是200")



? ? except Exception as e:

? ? ? ? print("請求主頁面出錯:",e)



if __name__ == '__main__':

? ? main()


獲取免費小說,免費小說隨時看的評論 (共 條)

分享到微博請遵守國家法律
牟定县| 巴东县| 潼南县| 买车| 余干县| 青州市| 乡宁县| 东源县| 景东| 郁南县| 余干县| 安阳县| 东山县| 花垣县| 和政县| 霸州市| 太仓市| 武胜县| 兖州市| 新竹县| 织金县| 密云县| 巴林左旗| 克山县| 波密县| 沐川县| 丁青县| 博湖县| 新疆| 通渭县| 玉门市| 汉川市| 玉树县| 博湖县| 淄博市| 游戏| 绥芬河市| 罗甸县| 仪陇县| 南平市| 安新县|