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

  • Home
  • SEARCH
  • 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 7065939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:01:10+00:00 2026-05-28T05:01:10+00:00

HTML <div class=productDescriptionWrapper> <p>A worm worth getting your hands dirty over. With over six

  • 0

HTML

<div class="productDescriptionWrapper">
<p>A worm worth getting your hands dirty over. With over six feet of crawl space, Playhut&rsquo;s Wiggly Worm is a brightly colored and friendly play structure.
</p>
<ul>  
   <li>6ft of crawl through fun</li>    
   <li>18&rdquo; diameter for easy crawl through</li>    
   <li>Bright colorful design</li>    
   <li>Product Measures: 18&quot;&quot;Diam x 60&quot;&quot;L</li>    
   <li>Recommended Ages: 3 years &amp; up<br />    &nbsp;</li>
</ul>
<p><strong>Intended for Indoor Use</strong></p>

Code

def GetBullets(self, Soup):

    bulletList = []

    bullets = str(Soup.findAll('div', {'class': 'productDescriptionWrapper'}))

    bullets_re = re.compile('<li>(.*)</li>')

    bullets_pat = str(re.findall(bullets_re, bullets))

    index = bullets_pat.findall('</li>')

    print index

how to extract p tags and li tags? Thanks!

  • 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-28T05:01:11+00:00Added an answer on May 28, 2026 at 5:01 am

    Notice the following:

    >>> from BeautifulSoup import BeautifulSoup
    >>> html = """ <what you have above> """
    >>> Soup = BeautifulSoup(html)
    >>> bullets = Soup.findAll('div', {'class': 'productDescriptionWrapper'})
    >>> ptags = bullets[0].findAll('p')
    >>> print ptags
    [<p>A worm worth getting your hands dirty over. With over six feet of crawl space,      Playhut&rsquo;s Wiggly Worm is a brightly colored and friendly play structure.
    </p>, <p><strong>Intended for Indoor Use</strong></p>]
    >>> print ptags[0].text
    A worm worth getting your hands dirty over. With over six feet of crawl space, Playhut&rsquo;s Wiggly Worm is a brightly colored and friendly play structure.
    

    You can get at the contents of your li tags in a similar manner.

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

Sidebar

Related Questions

$('div.box').html(hello) puts the word hello inside all my div's of class 'box'. They all
Is this html <div class='title centered'>SCE</div> <div class='description'> Magna tristique pulvinar porta montes, scelerisque
I have this HTML code: <div class='com_box'> <div class='com_box_c'> <div class='com_box_info'> <a id='quote'>quote</a> </div>
The HTML: <div id=timerList> ... <li rel=project class=open> <a class= style= href=><ins>&nbsp;</ins>Project C</a> </li>
How can I get DIV id or DIV class using Jquery if the HTML
following is my code HTML : <div id = content > <div class =
Suppose the following HTML div container <div id=container> <form> <div> <label class=error>Name</label> <input type=text
Suppose I have the following HTML: <div class=container> <span class=remove>remove</span> </div> and jquery: $(.container).delegate(.remove,
example: Html <div id = parent> <div class = clearDiv></div> </div> css: div.clearDiv {
I am using a polls plugin which generates the following HTML: <div class=pane> <ul

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.