网页抓取-如何识别网页上的主要内容 [英] Web scraping - how to identify main content on a webpage

查看:150
本文介绍了网页抓取-如何识别网页上的主要内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给出一个新闻文章网页(来自任何主要新闻来源,例如《时代》或彭博社),我想确定该页面上的主要文章内容,并丢弃其他杂项元素,例如广告,菜单,边栏,用户评论.

Given a news article webpage (from any major news source such as times or bloomberg), I want to identify the main article content on that page and throw out the other misc elements such as ads, menus, sidebars, user comments.

可以在大多数主要新闻网站上使用的通用方法是什么?

What's a generic way of doing this that will work on most major news sites?

有哪些好的数据挖掘工具或库? (最好是基于python)

What are some good tools or libraries for data mining? (preferably python based)

推荐答案

无法保证一定能做到这一点,但是您可能会使用的一种策略是尝试查找其中包含最可见文本的元素.

There's no way to do this that's guaranteed to work, but one strategy you might use is to try to find the element with the most visible text inside of it.

这篇关于网页抓取-如何识别网页上的主要内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆