当前位置:网站首页>Novel capture practice
Novel capture practice
2022-07-25 04:35:00 【Listen to my call, rookie evolution】
Change the link to the first chapter of the novel on this website 35 chinese
import os
path = '.\chromedriver.exe'
from lxml import etree
import re
from selenium import webdriver
import time
driver = webdriver.Chrome(executable_path=path)
driver.get('https://www.swzw.la/xs/288/288812/56975154.html')
driver.maximize_window()
time.sleep(1)
if not os.path.exists('./texts'):
os.mkdir('./texts')
for i in range(1,50):
source = driver.page_source
tree=etree.HTML(source)
title=tree.xpath('//*[@id="wrapper"]/div[5]/div[2]/div[2]/h1/text()')[0]
text="".join(tree.xpath('//*[@id="content"]//text()'))
file=open(r'D:/ Reptile new learning /Day1/texts/{}.txt'.format(i),'w', encoding='utf-8')
info=title+"\t"+text+"\n"
file.write(info)
file.close()
driver.find_element_by_xpath('//*[@id="wrapper"]/div[5]/div[2]/div[2]/div/a[4]').click()
time.sleep(1)
边栏推荐
- mitt.js:小型事件发布订阅库
- 今天很重要
- Implementation of some basic operation codes of string
- IT自媒体高调炫富,被黑客组织盯上,铁定要吃牢饭了…
- 6.7 billion dollars! The acquisition of IDT by Renesas Electronics was finally approved!
- MySQL -- index and transaction isolation level
- LVGL 8.2 Slider
- tiny-emitter.js:一个小型的事件订阅发布库
- 数据湖(十六):Structured Streaming实时写入Iceberg
- TS learning (VII): interface and type compatibility of TS
猜你喜欢

Method of setting document comments in idea (graphic version)
![[ CTF 学习 ] CTF 中的隐写集合 —— 图片隐写术](/img/32/2da78bd5866cfab9ee64dfcb1c1204.png)
[ CTF 学习 ] CTF 中的隐写集合 —— 图片隐写术

PyG搭建GCN实现链接预测

Unity 之 UPR优化建议汇总

2019 telecast retest test questions

Cannot make qopenglcontext current in a different thread: the solution to pyqt multithread crash

DOM event flow

5年经验的大厂测试/开发程序员,怎样突破技术瓶颈?大厂通病......

The application could not be installed: INSTALL_ FAILED_ USER_ RESTRICTED

How to test cookies
随机推荐
市场的调节
Introduction to fundamentals of operations research [1]
[internship] processing time
Simple understanding of RPC
Understand Huawei's 2018 financial report with one picture
Paper:《Peeking Inside the Black Box: Visualizing Statistical Learning with Plots of Individual Condi
Press the switch for the minimum number of times to turn on all lights
[cloud picture theory] 248 illustrated public network domain name resolution: easy domain name access to websites / mailboxes
Infinite connection · infinite collaboration | the first global enterprise communication cloud conference WECC is coming
Very clear organization
Millet 100W fast charging, 50W wireless charging technology exposure! Oppo Shen Yiren responded: boring!
Beijing University of Posts and telecommunications | RIS assisted in-house multi robot communication system joint deep reinforcement learning
Salt and ice particles cannot be distinguished
ThreadLocal Kills 11 consecutive questions
Docker install MySQL 5.7
[golang from introduction to practice] poker licensing game
LVGL Switch & Table
@Summary of ResponseBody annotation
LVGL 8.2 Tabview & Window
I didn't expect Mysql to ask these questions