BeautiFul Soup find()

Estimated reading: 1 minute 580 views

Find () method

The find method is used for finding out the first tag with the specified name or id and returning an object of type bs4.

				
					import requests
from bs4 import BeautifulSoup
URL= "https://en.wikipedia.org/wiki/List_of_state_and_union_territory_capitals_in_India"
page = requests.get(URL)
soup = BeautifulSoup(page.content,"html")
#print(soup)
get_anchoe_value = soup.find("a")
print(get_anchoe_value)

				
			

Leave a Comment

CONTENTS