下了一堆html,命名都是數(shù)字,想用正則匹配并挨個讀取解析于是,只能寫到這里import re
#重點在這里
#----------------------------------------------
files = re.findall(r'\d+\.html',這里咋寫)
#后面打算這樣
for file in files:
html = open(file,'r',encoding='utf-8')
#----------------------------------------------
#現(xiàn)在只能這樣
for i in range(0,49999):
try:
html = open(str(i)+'.html','r',encoding='utf-8')
except:
continue這里咋寫哪里咋寫 啊啊啊。。。
添加回答
舉報
0/150
提交
取消