diff --git a/Web Scraping with BeautifulSoup.py b/Web Scraping with BeautifulSoup.py index da4ce1e..d6fea58 100644 --- a/Web Scraping with BeautifulSoup.py +++ b/Web Scraping with BeautifulSoup.py @@ -41,6 +41,14 @@ # here i extarcted href data from anchor tag. print(links['href']) +## or another way +##extracting href(links) attribute and anchor() tag from page +for a in soup.find_all('a', href=True): + print ( a['href']) + +for i in links: + print(i.text) + # similarly i got class details from a anchor tag print(links['class']) @@ -92,5 +100,10 @@ overview=soup.find_all('table',class_='infobox vevent') for z in overview: print(z.text) - + +images=soup.find_all('img') + +images +##or +print(images)