vendredi 27 septembre 2019

not understanding the get() in webbrowser module

I came across the following code:

linkElems = soup.select('.r a') numOpen = min(5, len(linkElems)) for i in range(numOpen): webbrowser.open('http://google.com' + linkElems[i].get('href'))

Here I am not getting how they have used .get() with list as I know .get() is for dictionary only

the above snippent is from the programme trying to open first five goole search results in browser

please help

Thanks!




Aucun commentaire:

Enregistrer un commentaire