VOOZH about

URL: https://www.geeksforgeeks.org/python/how-to-scrape-all-the-text-from-body-tag-using-beautifulsoup-in-python/

⇱ How to scrape all the text from body tag using Beautifulsoup in Python? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to scrape all the text from body tag using Beautifulsoup in Python?

Last Updated : 23 Jul, 2025

strings generator is provided by Beautiful Soup which is a web scraping framework for Python. Web scraping is the process of extracting data from the website using automated tools to make the process faster. One drawback of the string attribute is that it only works for tags with string inside it and returns nothing for tags with further tags inside it. Thus to resolve this issue, a strings generator is used to get all the strings inside a tag, recursively.

Syntax:  

tag.strings 

Below given examples explain the concept of strings in Beautiful Soup. 
Example 1: In this example, we are going to get the strings.

Output: 

 Hello world 
 New heading 

Example 2:

Output: 
 


 


 

Comment