シンプルなRSSフィードのWebサイトを作成しようとしています。 RSSのほとんどの<img> xmlファイルのsrc値を取得するには?
let article = {
'title': item.title,
'image': item.image.url,
'link': item.link,
'description': item.description,
}
タイトルとリンク作業のフィードが、画像や説明がない:
は、私はこれを行うことにより、RSSフィードの数を取得することができます。
RSS料の多くは、このような記述の内部HTMLとしてイメージを持っているので:
{ title: 'The Rio Olympics Are Where TV Finally Sees the Future',
description: '<div class="rss_thumbnail"><img src="http://www.wired.com/wp-content/uploads/2016/08/GettyImages-587338962-660x435.jpg" alt="The Rio Olympics Are Where TV Finally Sees the Future" /></div>Time was, watching the Olympics just meant turning on your TV. That\'s changed—and there\'s no going back. The post <a href="http://www.wired.com/2016/08/rio-olympics-tv-finally-sees-future/">The Rio Olympics Are Where TV Finally Sees the Future</a> appeared first on <a href="http://www.wired.com">WIRED</a>.',...
は、どのように私はそれから、画像のURLを取得することができますか?
EDIT:
http.get("http://www.wired.com/feed/"...
.on('readable', function() {
let stream = this;
let item;
while(item = stream.read()){
let article = {
'title': item.title,
'image': item.image.url,
'link': item.link,
'description': item.description,
}
news.push(article);
}
})
これは私のコードの一部であり、基本的に私は有線RSSから画像のURLを取得しようとしています。
私が 'image':item.image.urlを使用しても、動作しません。だから私はそれを何に変えるべきですか?
私はあなたの答えを試みたが、うまくいかなかった。私は自分のコードを編集して追加しました。 – Dan
@ダンコードがあなたのために失敗したのは残念です....コードはどこで失敗しましたか?文字列から 'url'をフェッチするはずでした...また、 .... –