import re
import urllib.request
string=‘<div class="name">(.*?)</div>‘
huo=urllib.request.urlopen("https://read.douban.com/provider/all").read()
huo=huo.decode("utf-8")
huo1=re.compile(string).findall(str(huo))
hom=open(‘D:\hom.txt‘,‘w‘)
hom.write(str(huo1))
hom.close()
简单易了
原文地址:https://www.cnblogs.com/chunqing/p/9052761.html
时间: 2024-10-18 04:28:39