Skip to content

Commit 9538bb0

Browse files
authored
Merge pull request #2 from RishikeshMane/master
modified Web Scraping with BeautifulSoup.py
2 parents 76f9e6c + 27f62e8 commit 9538bb0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Web Scraping with BeautifulSoup.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ def set_browser_as_incognito(options):
5959
# here i extarcted href data from anchor tag.
6060
print(links['href'])
6161

62+
## or another way
63+
##extracting href(links) attribute and anchor(<a>) tag from page
64+
for a in soup.find_all('a', href=True):
65+
print ( a['href'])
66+
67+
for i in links:
68+
print(i.text)
69+
6270
# similarly i got class details from a anchor tag
6371
print(links['class'])
6472

@@ -110,5 +118,10 @@ def set_browser_as_incognito(options):
110118
overview=soup.find_all('table',class_='infobox vevent')
111119
for z in overview:
112120
print(z.text)
113-
121+
122+
images=soup.find_all('img')
123+
124+
images
125+
##or
126+
print(images)
114127

0 commit comments

Comments
 (0)