【发布时间】:2016-08-04 07:28:39
【问题描述】:
我试图从链接中抓取新闻文章:-
但我没有将页面中的文本放到 index(elasticsearch) 中的内容字段中。
爬取的结果是:-
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 0.09492774,
"hits": [
{
"_index": "news",
"_type": "doc",
"_id": "http://www.bloomberg.com/press-releases/2016-07-08/network-1-announces-settlement-of-patent-litigation-with-apple-inc",
"_score": 0.09492774,
"_source": {
"tstamp": "2016-08-04T07:21:59.614Z",
"segment": "20160804125156",
"digest": "d583a81c0c4c7510f5c842ea3b557992",
"host": "www.bloomberg.com",
"boost": "1.0",
"id": "http://www.bloomberg.com/press-releases/2016-07-08/network-1-announces-settlement-of-patent-litigation-with-apple-inc",
"url": "http://www.bloomberg.com/press-releases/2016-07-08/network-1-announces-settlement-of-patent-litigation-with-apple-inc",
"content": ""
}
},
{
"_index": "news",
"_type": "doc",
"_id": "http://www.bloomberg.com/press-releases/2016-07-05/apple-donate-life-america-bring-national-organ-donor-registration-to-iphone",
"_score": 0.009845509,
"_source": {
"tstamp": "2016-08-04T07:22:05.708Z",
"segment": "20160804125156",
"digest": "2a94a32ffffd0e03647928755e055e30",
"host": "www.bloomberg.com",
"boost": "1.0",
"id": "http://www.bloomberg.com/press-releases/2016-07-05/apple-donate-life-america-bring-national-organ-donor-registration-to-iphone",
"url": "http://www.bloomberg.com/press-releases/2016-07-05/apple-donate-life-america-bring-national-organ-donor-registration-to-iphone",
"content": ""
}
}
]
}
}
我们可以注意到内容字段是空的。我在 nutch-site.txt 中尝试了不同的选项。但结果还是一样。请帮我解决这个问题。
【问题讨论】:
标签: web-crawler nutch