티스토리 뷰
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
31
32
33
34
35
36
37
|
from bs4 import BeautifulSoup # conda install -c anaconda beautifulsoup4
import re
doc = ['<html><head><title>Page title</title></head>',
'<body><p id="firstpara" align="center">This is paragraph <b>one</b>.',
'<p id="secondpara" align="blah">This is paragraph <b>two</b>.',
'</html>']
soup = BeautifulSoup(''.join(doc))
print(soup.prettify())
"""
<html>
<head>
<title>
Page title
</title>
</head>
<body>
<p align="center" id="firstpara">
This is paragraph
<b>
one
</b>
.
<p align="blah" id="secondpara">
This is paragraph
<b>
two
</b>
.
</p>
</p>
</body>
</html>
"""
|
cs |
************
1 2 3 4 5 6 7 8 9 10 11 | from bs4 import BeautifulSoup # conda install -c anaconda beautifulsoup4 import re doc = ['<html><head><title>Page title</title></head>', '<body><p id="firstpara" align="center">This is paragraph <b>one</b>.', '<p id="secondpara" align="blah">This is paragraph <b>two</b>.', '</html>'] soup = BeautifulSoup(''.join(doc)) print(soup.prettify()) | cs |
'5. 파이썬' 카테고리의 다른 글
선형대수의 데이터 유형과 axis 이해 (0) | 2020.09.22 |
---|---|
파이참(Pycharm) 프로젝트 시작하기 - Hello World ! (0) | 2020.09.16 |
Anaconda on VSCode "conda create -n venv" (0) | 2020.09.16 |
Flask Hello World on VSCode -2- (0) | 2020.09.16 |
장고 DRF 설정 및 Pycharm 설치 (0) | 2020.09.11 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- intellij
- jQuery
- Oracle
- JPA
- KAFKA
- ERD
- JUnit
- docker
- Algorithm
- Mongo
- terms
- Eclipse
- database
- tensorflow
- springMVC
- COLAB
- React
- Java
- SQLAlchemy
- Django
- mariadb
- vscode
- SpringBoot
- nodejs
- Git
- Python
- AWS
- Mlearn
- maven
- FLASK
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
글 보관함