回答編集履歴
2
API、RSSについて追記
answer
CHANGED
@@ -17,5 +17,7 @@
|
|
17
17
|
{"uri":"/2019/02/19/business/japan-companies-uk-economy/index.html","headline":"\u003cstrong>Japan Inc poured billions into Britain. Now it's having regrets\u003c/strong>","thumbnail":"//cdn.cnn.com/cnnnext/dam/assets/181128163340-london-waterloo-bridge-pedestrians-small-11.jpg","duration":"","description":"Japan's top companies are losing patience with the United Kingdom as Brexit fast\u003cstrong> \u003c/strong>approaches. ","layout":""}
|
18
18
|
```
|
19
19
|
|
20
|
-
これでは`soup.find()`で見つからない訳ですね。
|
20
|
+
これでは`soup.find()`で見つからない訳ですね。ヒントになれば幸いです。
|
21
|
+
|
22
|
+
なおCNNは[CNN API](https://newsapi.org/s/cnn-api)や[RSS](http://edition.cnn.com/services/rss/)も公開しています。
|
21
|
-
|
23
|
+
記事タイトルとURLならこちらから取得するのもいいかもしれません。
|
1
補足
answer
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
こんにちは。
|
2
2
|
下のようなコードで取得したHTMLをテキスト出力してみると、
|
3
|
-
ニュース部分はJSONで返して、ブラウザ側で動的に生成しているようです。
|
3
|
+
ニュース部分はJSONで返して、ブラウザ側で動的にHTMLを生成しているようです。
|
4
4
|
|
5
5
|
```Python
|
6
6
|
from bs4 import BeautifulSoup
|