나는이 내용처럼 뭔가의 이름을 얻을 필요가re.findall 및 정규식
names = []
matches = re.findall(r'''<a\stitle="(?P<title>[^">]+)"\sname="(?P<name>[^">]+)"></a>''',content, re.VERBOSE)
for (title, name) in matches:
if title == name:
names.append(title)
return names
... 내가 얻을 이름 = [] ; 뭐가 잘못 되었 니?. 감사.
이 * HTML을 구문 분석에 대한 정규식을 사용할 필요가,이 질문에 대한 첫 번째 대답을 읽어 http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml -self-contained-tags –