Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 193645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:31:41+00:00 2026-05-11T16:31:41+00:00

Of course an HTML page can be parsed using any number of python parsers,

  • 0

Of course an HTML page can be parsed using any number of python parsers, but I’m surprised that there don’t seem to be any public parsing scripts to extract meaningful content (excluding sidebars, navigation, etc.) from a given HTML doc.

I’m guessing it’s something like collecting DIV and P elements and then checking them for a minimum amount of text content, but I’m sure a solid implementation would include plenty of things that I haven’t thought of.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:31:41+00:00Added an answer on May 11, 2026 at 4:31 pm

    Try the Beautiful Soup library for Python. It has very simple methods to extract information from an html file.

    Trying to generically extract data from webpages would require people to write their pages in a similar way… but there’s an almost infinite number of ways to convey a page that looks identical let alone all the conbinations you can have to convey the same information.

    Was there a particular type of information you were trying to extract or some other end goal?

    You could try extracting any content in ‘div’ and ‘p’ markers and compare the relative sizes of all the information in the page. The problem then is that people probably group information into collections of ‘div’s and ‘p’s (or at least they do if they’re writing well formed html!).

    Maybe if you formed a tree of how the information is related (nodes would be the ‘p’ or ‘div or whatever and each node would contain the associated text) you could do some sort of analysis to identify the smallest ‘p’ or ‘div’ that encompases what appears to be the majority of the information.. ?

    [EDIT] Maybe if you can get it into the tree structure I suggested, you could then use a similar points system to spam assassin. Define some rules that attempt to classify the information. Some examples:

    +1 points for every 100 words
    +1 points for every child element that has > 100 words
    -1 points if the section name contains the word 'nav'
    -2 points if the section name contains the word 'advert'
    

    If you have a lots of low scoring rules which add up when you find more relevent looking sections, I think that could evolve into a fairly powerful and robust technique.

    [EDIT2] Looking at the readability, it seems to be doing pretty much exactly what I just suggested! Maybe it could be improved to try and understand tables better?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to serve an html page that includes unicode text using django and
Of course, I can explain it in whole books. But I read a few
Of course we can do this, but is it alright to do so? Are
I'm using a file, page.php, as an HTML container for several content files; i.e.,
i made a simple html page that includes npruntime plug-in and it works fine
I'm working on a PHP parser that parses my school's HTML 'groups' page. These
Is there a way I can put some code on my page so when
Is there any way to have multiple distinct HTML pages contained within a single
I'm using Android, and I've created a Webview which nicely opens my HTML page
I've got a textbox where the user can enter text that includes html markup.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.