回答編集履歴

2

lxmlの部分は消します

2016/11/15 08:00

投稿

toritoritorina
toritoritorina

スコア972

test CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
 
26
26
 
27
- soup = BeautifulSoup(text, 'lxml')
27
+ soup = BeautifulSoup(text)
28
28
 
29
29
 
30
30
 

1

コメントに誤字

2016/11/15 08:00

投稿

toritoritorina
toritoritorina

スコア972

test CHANGED
@@ -32,7 +32,7 @@
32
32
 
33
33
  target = soup.select('div[class="hoge"]')[0]
34
34
 
35
- print(target.p) # <p>hogehoge</p>
35
+ print(target.p) # <p>hogehoge</p>と表示される
36
36
 
37
37
 
38
38
 
@@ -40,6 +40,6 @@
40
40
 
41
41
  target = soup.select('div[class="hoge spam"]')[0]
42
42
 
43
- print(target.p) # <p>hogehoge</p>
43
+ print(target.p) # <p>hoge</p>と表示される
44
44
 
45
45
  ```