我抓取了一個網站。頁面上有很多常見的內容,如下拉菜單,導航。如何防止這些內容被索引?阻止網頁的某些部分被索引
1
A
回答
0
自從過去2年來我一直在使用nutch代碼庫,並且據我所知,這是不可能的。一旦內容進入nutch段,你不能剝離下拉菜單,導航等部分,並只保留所需的東西。
如果您或其他人知道如何去做(不需要修改代碼),請分享一下。
1
不確定,如果你仍然需要這樣做,但是如果你這樣做,你可以嘗試blacklist_whitelist插件,它可以在https://issues.apache.org/jira/browse/NUTCH-585找到。
該插件允許您擁有要阻止或允許但不是兩者的元素列表。 例如:
<property>
<name>parser.html.blacklist</name>
<value>noscript,div,#footer</value>
<description>
A comma-delimited list of css like tags to identify the elements which should
NOT be parsed. Use this to tell the HTML parser to ignore the given elements, e.g. site navigation.
It is allowed to only specify the element type (required), and optional its class name ('.')
or ID ('#'). More complex expressions will not be parsed.
Valid examples: div.header,span,p#test,div#main,ul,div.footercol
Invalid expressions: div#head#part1,#footer,.inner#post
Note that the elements and their children will be silently ignored by the parser,
so verify the indexed content with Luke to confirm results.
Use either 'parser.html.blacklist' or 'parser.html.whitelist', but not both of them at once. If so,
only the whitelist is used.
</description>
</property>
相關問題
- 1. 阻止某些html元素被搜索引擎索引
- 2. 有沒有辦法阻止Googlebot索引頁面的某些部分?
- 3. 阻止某些網頁與htaccess的
- 4. 阻止搜索引擎索引網頁
- 5. 停止部分頁面被搜索引擎索引?
- 6. MVC中網頁的某些部分
- 7. 阻止某些網址在瀏覽器中被打開
- 8. 如何在使用php cURL時阻止網址的某些部分?
- 9. 在Opencart中阻止鏈接被索引
- 10. Dokuwiki:阻止某些部分進行編輯?
- 11. 阻止谷歌索引我的頁面
- 12. 停止索引某些圖像
- 13. 如何阻止livechatinc.com將索引我的敏感網站頁面?
- 14. 是否有可能阻止谷歌的部分頁面從谷歌索引
- 15. 如何阻止某些設備和某些瀏覽器阻止訪問我的網站?
- 16. 阻止某些網站訪問某個文件
- 17. 如何讓某些頁面不被搜索引擎編入索引?
- 18. 如何僅使用Nutch索引某些網址的頁面?
- 19. 防止Googlebot頻繁重新索引某些頁面
- 20. 檢索鏈接網址的某些部分的最佳方法?
- 21. 在某些索引
- 22. 查看HTML頁面的某些部分?
- 23. 搜索引擎顯示某些頁面
- 24. 阻止Javascript:Firebase .set()阻止/凍結網頁
- 25. 我想阻止搜索引擎在WordPress第一頁後索引分類
- 26. 如何使用php打印出網頁的某些部分?
- 27. 如何在android webview中顯示網頁的某些部分?
- 28. 阻止我的網站上的某些設備和瀏覽器
- 29. 網站區域被阻止?
- 30. 如何阻止某些IP(用戶)訪問我的網站?
任何人有想法嗎? – thunder 2012-04-02 16:38:49