import re
with open('index.html', 'r', encoding='utf-8')as f:
html = f.read()
print(html)
pattern_1 = '<div class="email">(.*?)</div>'
ret_1 = re.findall(pattern_1,html)
print(ret_1)
pyCharm中敲入上述代码,运行后的错误提示:
AttributeError: partially initialized module ‘re’ has no attribute ‘findall’ (most likely due to a circular import)
D:\Python3.8.5\python