Show text inside the tags using BeautifulSoup Last Updated : 15 Mar, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report Prerequisite: RequestsBeautifulSoup In this article, we will learn how to get a text from HTML tags using BeautifulSoup. Here we will use requests & BeautifulSoup Module in Python. The requests library is an integral part of Python for making HTTP requests to a specified URL. Whether it be REST APIs or Web Scraping, requests are must be learned for proceeding further with these technologies. When one makes a request to a URI, it returns a response. Python requests provide inbuilt functionalities for managing both the request and response. pip install requests Beautiful Soup is a Python library designed for quick turnaround projects like screen-scraping. pip install beautifulsoup4 Method 1: We can use text property. It will only print the text from the tag. Python3 # Import Required Module import requests from bs4 import BeautifulSoup # Web URL Web_url = "https://www.geeksforgeeks.org/" # Get URL Content r = requests.get(Web_url) # Parse HTML Code soup = BeautifulSoup(r.content, 'html.parser') tag = soup.find("p") print(tag.text) Output: Skip to content Method 2: We can also use get_text() method. This method is used for printing the whole text of the web page Python3 # Import Required Module import requests from bs4 import BeautifulSoup # Web URL Web_url = "https://www.geeksforgeeks.org/" # Get URL Content r = requests.get(Web_url) # Parse HTML Code soup = BeautifulSoup(r.content, 'html.parser') tag = soup.find("p") print(tag.get_text()) Output: February 1, 2021 Method 3: If there is only a string inside the tag then we can use the string property. Python3 # Import Required Module import requests from bs4 import BeautifulSoup # Web URL Web_url = "https://www.geeksforgeeks.org/" # Get URL Content r = requests.get(Web_url) # Parse HTML Code soup = BeautifulSoup(r.content, 'html.parser') tag = soup.find("p") print(tag.string) Output: February 1, 2021 Comment More infoAdvertise with us Next Article BeautifulSoup - Search by text inside a tag A abhigoya Follow Improve Article Tags : Python Python BeautifulSoup Practice Tags : python Similar Reads Find the text of the given tag using BeautifulSoup Web scraping is a process of using software bots called web scrapers in extracting information from HTML or XML content of a web page. Beautiful Soup is a library used for scraping data through python. Beautiful Soup works along with a parser to provide iteration, searching, and modifying the conten 2 min read Find the siblings of tags using BeautifulSoup Prerequisite: BeautifulSoup BeautifulSoup(bs4) is a Python library for pulling data out of HTML and XML files. This module does not come in built-in with Python. To install this type the below command in the terminal. In this article, we will learn about siblings in HTML tags using BeautifulSoup. He 2 min read BeautifulSoup - Search by text inside a tag Prerequisites: Beautifulsoup Beautifulsoup is a powerful python module used for web scraping. This article discusses how a specific text can be searched inside a given tag. INTRODUCTION: BeautifulSoup is a Python library for parsing HTML and XML documents. It provides a simple and intuitive API for 4 min read How to find a HTML tag that contains certain text using BeautifulSoup ? BeautifulSoup, a powerful Python library for web scraping, simplifies the process of parsing HTML and XML documents. One common task is to find an HTML tag that contains specific text. In this article, we'll explore how to achieve this using BeautifulSoup, providing a step-by-step guide. Required Py 4 min read How to Scrape Nested Tags using BeautifulSoup? We can scrap the Nested tag in beautiful soup with help of. (dot) operator. After creating a soup of the page if we want to navigate nested tag then with the help of. we can do it. For scraping Nested Tag using Beautifulsoup follow the below-mentioned steps. Step-by-step Approach Step 1: The first s 3 min read How to Search the Parse Tree using BeautifulSoup? Searching the parse tree means we need to find the tag and the content of the HTML tree. This can be done in many ways. But the most used method for searching the parse tree is the find() and find_all() method. With the help of this, we can parse the HTML tree using Beautifulsoup. For Searching the 2 min read Like