티스토리 뷰

Programming/python

python - BeautifulSoup, re

RosyPark 2019. 9. 6. 11:12

1. BeautifulSoup

1.1 HTML 태그제거 

1
after = BeautifulSoup(before, "html5lib").get_text()
cs

 

 

 

 

2. re

1
after = re.sub("[^a-zA-Z]"" ", before ) # 영어 문자를 제외한 나머지는 모두 공백으로 바꾼다.
cs

 

 

 

'Programming > python' 카테고리의 다른 글

pandas 데이터 전처리하는 방법  (0) 2019.09.09
[5] python pandas 파일 정리 mission  (0) 2019.09.08
python - matplot & seaborn  (0) 2019.09.05
python - PIL  (0) 2019.09.05
python - pandas (1)  (0) 2019.09.05
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG more
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함