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 7802953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:24:54+00:00 2026-06-02T01:24:54+00:00

I have this html data which I need to parse to extract data from

  • 0

I have this html data which I need to parse to extract data from it.But it has so many tags and data is also difficult too navigable for me.From below Html data i need to create a python dictionary list that will look like:

[{“School”:”Childs
play”},{“Place”:”newyork”},{“Level”:”four”},{“Country”:”USA”},{“Level
Of Course”:”Easy”}]

<div class="quick">
 <strong>School</strong><br /> Childs play <br /><br />
 <strong>Place</strong><br />
 <a href="Search.aspx?Menu=new&amp;Me=">newyork</a><br /><br />
 <strong>Level</strong><br />four<br /><br />
 <strong>Country</strong><br />USA<br /><br />
 <strong>Level Of Course</strong><br />Easy<br /><br />
</div>

I tried using beautifulsoup but didnt get success .Please help

  • 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-06-02T01:24:56+00:00Added an answer on June 2, 2026 at 1:24 am

    Unfortunately, the HTML is not ideally constructed for parsing, but it is possible to extract the data into a meaningful Python dictionary.

    from BeautifulSoup import BeautifulSoup
    soup = BeautifulSoup(htmlString)
    
    raw_data = soup.find(**{"class": "quick"}).contents
    data = [x for x in raw_data if not hasattr(x, "name") or not x.name == "br"]
    

    Using if not hasattr(x, "name") or not x.name == "br" first checks to make sure that the item is an instance of NavigableString and then checks that the element is not a <BR> tag.

    data will then be of the format [<KEY>, <VALUE>, <KEY>, <VALUE>] from which it should be fairly trivial to extract the data.

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

Sidebar

Related Questions

I have this HTML from which I have to extract data: <html> <head></head> <body>
I have some data enclosed in HTML tags. I want to insert this data
I have this HTML: <form action='uploadhandle.php' method='POST' enctype=multipart/form-data> <input type='file' class='fileinput' id='photo1' name='photo1'> <input
I have this code, $('.editLayout #changeLayout').click(function() { $('html').height($(document).height()); $('#fluidWrap').hide('scale'); $.ajax({ data: { mainLayout: true
I have a html form with the data by this post method 'form id='form1'
I have text stored in SQL as HTML. I'm not guaranteed that this data
I'm about to start writing a program which will attempt to extract data from
I have this div which contents depends of the current time of HTML embedded
I have a web scraper built to parse html from a website and I'm
I have a HTML file having GPS coordinates which I want to extract, I

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.