Introduction
In this blog, I am going to extract the information from websites using beautiful soup in Python. It will be displaying the website information on the Python console screen.
Software requirement
Python 3.5 and IDLE (Python 3.5)
Programming code
- #Extracting URL's from any website using beautifulSoup
- #import packages
- from bs4 import BeautifulSoup
- import requests
- search=input("Enter search term : ")
- #set parameter
- params={"q": search}
- #request
- r=requests.get("http://www.google.com",params=params)
- #using beautifulSoup fuction
- soup=BeautifulSoup(r.text)
- #output statement
- print(soup.prettify())
About the code
First, I am importing the beautiful soup 4 and request modules.
Next, setting parameters and requesting website code.
Next, using a beautiful soup function to get website information.
Finally, I have written the output statement to show the website information in the console.
Then, let’s execute the code.
Output

JAYASURYA BITPosted Sep 11, 2018, 4:01 AM
Thambi antha library ethuku ??