본문으로 바로가기

python 문자열에서 html 태그 없애기

category Python 2020. 2. 24. 15:32
import re

def remove_tag(content):
   cleanr =re.compile('<.*?>')
   cleantext = re.sub(cleanr, '', content)
   return cleantext

 

출처 : https://www.fun25.co.kr/blog/python-remove-html-tag/?page=8

'Python' 카테고리의 다른 글

python if문 한 줄로 표현  (0) 2020.02.25
python 에러 체크 예제  (0) 2020.02.24
list[]를 문자열로 합치기  (0) 2020.02.24
json 등 딕셔너리에 특정 키 존재 확인  (0) 2020.02.24
Confluence python-api 참고  (0) 2020.02.24