Date: 10 Oct 2022

Module : BeautifulSoup


Installation : pip install BeautifulSoup


About:

Beautiful Soup is a library that makes it easy to scrape information from
web pages. It sits atop an HTML or XML parser, providing Pythonic idioms
for iterating, searching, and modifying the parse tree.


Source:

import requests

from bs4 import BeautifulSoup



URL = "http://www.values.com/inspirational-quotes";

r = requests.get(URL)



soup = BeautifulSoup(r.content, 'html5lib') # If this line causes an error,
run 'pip install html5lib' or install html5lib

print(soup.prettify())


Reference:

https://pypi.org/project/BeautifulSoup/
_______________________________________________
Chennaipy mailing list
Chennaipy@python.org
https://mail.python.org/mailman/listinfo/chennaipy

Reply via email to