import requests
def getHtml(url):
headers={'User-Agent':'Mozilla'}
r=requests.get(url,headers=headers)
r.encoding=r.apparent_encoding
return r.text
def save(content):
with open('d:/4/明克街13号.txt','a',encoding='utf8') as f:
f.write(content)
html=getHtml("https://www.xbiquwx.la/116_116117/")
标签=html[html.find('
- '):html.find('
for i in range(标签.count(' start=标签.find('href="')+6
end=标签.find('" ')
url='https://www.xbiquwx.la/116_116117/'+标签[start:end]
标签=标签[end+1:]
html=getHtml(url)
cname=html[html.find('')+4:html.find('')]
content=html[html.find('')+18:html.find('')]
print(cname)
save(cname+'n'+content.replace('
','n'))



