Beautifuelsoup - Python : I was hoping to ask a pretty simple question. I have come across the below code and have not been able to find a decent explanation as to i) what exactly does the .attrs function do in this cose ii) what is the function of the ['href'] part at the end i.e. what exactly does that part of the code execute. 

thanks very much for any help! 

    from urllib.request import urlopen
    from bs4 import BeautifulSoup
    html = urlopen("url")
    bsObj = BeautifulSoup(html)
    for link in bsObj.findAll("a"):
	    if 'href' in link.attrs:
		print (link.attrs['href']) 