How to get Page Title of Webpage using Python

There are many ways to achieve this but the best one is to use libraries requests, bs4 and lxml. So let's install these libraries using pip. If you guys don't have pip installed them get it installed using sudo apt-get install python-pip.

sudo pip install requests
sudo pip install bs4
sudo pip install lxml

Now let's create our python file

import requests
from bs4 import BeautifulSoup as bs

req = requests.get('')
soup = bs(req.content, 'lxml')

Now run it.


Leave a Reply

Your email address will not be published. Required fields are marked *

The reCAPTCHA verification period has expired. Please reload the page.