仅供参考!!!
def requ(n):
i=str(n+1)
if n!=0:
url='https://cet4.koolearn.com/20131106/783888_'+i+'.html'
else:
url='https://cet4.koolearn.com/20131106/783888'+'.html'
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) '
'Chrome/100.0.4896.127 Safari/537.36'}
reponse = r.get(url=url, headers=headers)
time.sleep(0.001)
reponse.encoding = "utf-8"
cihui = reponse.text
ex='
\\u3000(.*?)
'
ci=re.findall(ex,cihui,re.S)
if i=='15':
ci=ci[:-1]
if i=='1':
ci=ci[1:]
with open('./text2.txt','a+',encoding='utf-8') as fp:
for i in range(len(ci)):
fp.write(ci[i]+'\n')
print("\r{}\tDownload Progress{:-4.1f}%".format('▮'* (int(i/10)), ((i/(len(ci)-1))*100)), end="")
time.sleep(0.0001)
fp.close()
print("\t\t第{}个任务完成!!!".format(n+1))
print("任务开始".center(50//2,"-"))
for i in range(15):
requ(i)
print("任务结束".center(50//2,"-"))
0.0分
0 人评分
数列排序 (C语言代码)浏览:858 |
拆分位数 (C语言代码)浏览:1361 |
计算质因子 (C++代码)浏览:1825 |
C语言程序设计教程(第三版)课后习题6.11 (C语言代码)浏览:565 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:863 |
【矩阵】 (C++代码)浏览:999 |
1009题解浏览:802 |
1126题解浏览:649 |
判定字符位置 (C语言代码)浏览:849 |
敲七 (C++代码)浏览:1119 |