Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion Web Scraping with BeautifulSoup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@
# here i extarcted href data from anchor tag.
print(links['href'])

## or another way
##extracting href(links) attribute and anchor(<a>) 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'])

Expand Down Expand Up @@ -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)