Home > Notes > Web Scrapping and BeautiFul Soup

BeautiFul Soup Introduction and Explanation

Web Scrapping and BeautiFul Soup

Python Request_library Explanation
BeautiFul Soup search()
BeautiFul Soup Introduction and Explanation
BeautiFul Soup find_all()
BeautiFul Soup find()
BeautiFul Soup search()

BeautiFul Soup Introduction and Explanation

BeautiFul Soup Introduction and Explanation

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_territo
 page = requests.get(URL)
 soup = BeautifulSoup(page.content,"html")
 #print(soup)
 get_title = soup.title
 print(get_title.text)

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_territo
 page = requests.get(URL)
 soup = BeautifulSoup(page.content,"html")
 #print(soup)
 get_title = soup.title
 print(get_title.text)