from bs4 import BeautifulSoup
import requests
html_text = requests.get( ‘https://in.kompass.com/r/tamil-nadu/in_intn/’ ).text
soup = BeautifulSoup(html_text,’lxml’)
location = soup.find (‘span’,class_= ‘placeText’)
print(location)
PS C:UsersvinnyOneDriveDesktopbs4project> & C:/Users/vinny/AppData/Local/Programs/Python/Python312/python.exe c:/Users/vinny/OneDrive/Desktop/bs4project/main.py
None
New contributor
MADASU VINEETH RAO is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1