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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:38:31+00:00 2026-06-15T00:38:31+00:00

Example: import bs4 html = ”’ <div class=short-description std > <em>Android Apps Security</em> provides

  • 0

Example:

import bs4

html = '''
<div class="short-description std ">
<em>Android Apps Security</em> provides guiding principles for how to 
best design and develop Android apps with security in mind. The book explores 
techniques that developers can use to build additional layers of security into 
their apps beyond the security controls provided by Android itself.             
<p class="scroll-down">∨ <a href="#main-desc" onclick="Effect.ScrollTo(
'main-desc', { duration:'0.2'}); return false;">Full Description</a> ∨</p></div>
'''
soup = bs4.BeautifulSoup(html)

How do I get the following(a beautifulsoup object) from soup?

<div class="short-description std ">
<em>Android Apps Security</em> provides guiding principles for how to 
best design and develop Android apps with security in mind. The book explores 
techniques that developers can use to build additional layers of security into 
their apps beyond the security controls provided by Android itself.             
</div>
  • 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-15T00:38:33+00:00Added an answer on June 15, 2026 at 12:38 am

    Simply search for it:

    soup.find('p', class_='scroll-down')
    

    I used the class to limit the find, but since there are no other p elements that’s a little redundant here.

    If, instead, you need to remove the tag, use the above method to first find it, then call .extract() on it to remove it from the document:

    >>> soup.find('p', class_='scroll-down').extract()
    <p class="scroll-down"> <a href="#main-desc" onclick="Effect.ScrollTo(
    'main-desc', { duration:'0.2'}); return false;">Full Description</a> </p>
    >>> print soup
    
    <div class="short-description std ">
    <em>Android Apps Security</em> provides guiding principles for how to 
    best design and develop Android apps with security in mind. The book explores 
    techniques that developers can use to build additional layers of security into 
    their apps beyond the security controls provided by Android itself.             
    </div>
    

    Two things: the removed tag is returned from the .extract() method, you could save it for later use. The tag is removed from the document altogether, you’d have to re-add it manually later if you still need it to be in the document anyway.

    Alternatively, you could use the .decompose() method, which deletes the tag from the document altogether, without returning a reference. The tag is then gone forever.

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

Sidebar

Related Questions

Let's have an example like below: package xliiv.sandbox; import android.app.Activity; import android.os.Bundle; import android.util.Log;
Take the following minimal example: import abc class FooClass(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def
Based on the following example : import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.SwingConstants; public class
Please, take a look at this example: import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Test
example: import scala.actors._ import Actor._ class BalanceActor[T <: Actor] extends Actor { val workers:
Example: import user class Thing(object): def doSomething(self): u = user.User(1) print u.name >> UnboundLocalError:
Example: import sys class Test(): def __init__(self): self.a = 'a' self.b = 'b' self.c
I have the following example: import java.util.EnumSet; import java.util.Iterator; public class SizeSet { public
Take the following generics example import java.util.List; import java.util.ArrayList; public class GenericsTest { private
Consider this example : import java.lang.reflect.Field; public class Test { public static void main(String[]

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.