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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:09:44+00:00 2026-06-04T15:09:44+00:00

I used page.prettify() to tidy up the HTML, and this is the text that

  • 0

I used page.prettify() to tidy up the HTML, and this is the text that I want to extract now:

        <div class="item">
         <b>
          name
         </b>
         <br/>
         stuff here
        </div>

My target is to extract the stuff here from there, but I am stumped as it is not wrapped in any tags except that div, which has other stuff in it already. And also the additional whitespace in front of every line makes it harder.

What would be the way to do this?

  • 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-04T15:09:45+00:00Added an answer on June 4, 2026 at 3:09 pm

    A combination of find and nextSibling works for the example that you posted.

    soup = BeautifulSoup(""" <div class="item"> <b> name </b>  <br/>  stuff here </div>""")
    soup.find("div", "item").find('br').nextSibling
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used fieldset tag in HTML page, whereby i need some text to
I used this page: http://developer.android.com/guide/topics/media/camera.html To learn how to use the existing camera app
In my web page i used a gridview. In this gridview it shows a
I am working on a web page that used a fixed width layout, centered
I used this code to print the current page: <form> <input type=button value=Print onClick=window.print();
I have a page that allows for used input, when the user inputs his/her
I used text boxes and a submit button on my .aspx page and I
I have a viewController, in that i have used Page control. and each page
In MVC2 I have used Page.User.Identity.Name using the <%@ Control Language=C# Inherits=System.Web.Mvc.ViewUserControl %> How
I have used this page from MSDN to apply a custom style to my

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.