BeautiFul Soup Introduction and Explanation

Estimated reading: 1 minute 351 views

Beautiful Soup

Beautiful Soup is a Python package for parsing HTML and XML documents.
It creates a parse tree for parsed pages that can be used to extract data from HTML,
which is useful for web scraping.

				
					import requests
from bs4 import BeautifulSoup


URL= "https://en.wikipedia.org/wiki/List_of_state_and_union_territory_capitals_in_India"

page = requests.get(URL)

soup = BeautifulSoup(page.content,"html")
#print(soup)
get_title = soup.title
print(get_title.text)
				
			

Leave a Comment

CONTENTS