老师QQ:2024964385 加老师QQ可以免费领取学习资料及免费答疑https://flowus.cn/share/3c42674d-8e6f-42e3-a3f6-bc1258034676
from urllib.request import urlopen
import re
url='http://127.0.0.1/upload-labs-master/'
res=urlopen(url).read().decode()
p1='<a id=.*? href=.*?>(.*?)</a>'
s=re.findall(p1,res)
'''
<a id='.*?' href=".*?">(.*?)</a>
'''
for i in s:
print(i)
r=open(r'C:\Users\hbzx\Desktop\x.txt','w')
r.writelines(s)
r.close()