回答編集履歴
1
コード修正
answer
CHANGED
@@ -6,8 +6,8 @@
|
|
6
6
|
url = 'http://news.yahoo.co.jp/topics'
|
7
7
|
r = requests.get(url)
|
8
8
|
|
9
|
-
print(r.status_code)
|
9
|
+
print(r.status_code) # 200
|
10
|
-
print(r.encoding)
|
10
|
+
print(r.encoding) # UTF-8
|
11
11
|
soup = BeautifulSoup(r.content, 'html.parser')
|
12
12
|
|
13
13
|
elements = soup.find_all('title')
|