Codied To Clipboard !
Home > Notes > Web Scrapping and BeautiFul Soup
find_all is used for returning all the matches after scanning the entire document.
# a.) getting all anchor tag import requests from bs4 import BeautifulSoup URL= "https://en.wikipedia.org/wiki/List_of_state_and_union_territo page = requests.get(URL) soup = BeautifulSoup(page.content,"html") #print(soup) get_all_anchor_value = soup.find_all("a") for i in get_all_anchor_value: print(i)
find_all is used for returning all the matches after scanning the entire document.
import requests from bs4 import BeautifulSoup URL= "https://en.wikipedia.org/wiki/List_of_state_and_union_territo page = requests.get(URL) soup = BeautifulSoup(page.content,"html") #print(soup) get_all_anchor_value = soup.find_all("a") for i in get_all_anchor_value: print(i)
find_all is used for returning all the matches after scanning the entire document.
import requests from bs4 import BeautifulSoup URL= "https://en.wikipedia.org/wiki/List_of_state_and_union_territo page = requests.get(URL) soup = BeautifulSoup(page.content,"html") #print(soup) get_all_anchor_value = soup.find_all("a") for i in get_all_anchor_value: print(i.get("href"))