I am writing a Python 3 code for web scraping using beautiful soup. Below is the code:
from bs4 import BeautifulSoup as BS
soup = BS(html, 'html.parser')
# finding all 'a' tags of the page whose class was 'image'
containers = soup.findAll('a', {'class': 'image'})
print(len(containers)) # containers length is 15
Now I need to write a loop and find out all the href components from the 'a' tag. How do I do this ?