在运行下列代码时,出现了问题
mail1 = soup.find("section",attrs = {"class":"col-md-9"}).find_all('p')
mail2 = [i.text for i in mail1]
match2 = re.search(r'[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)', str(mail2)).group()
mails.append(match2)
结果是:
match2 = re.search(r'[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)', str(mail2)).group()
AttributeError: 'NoneType' object has no attribute 'group'
请问应如何解决?