What is .attrs ?
tag.attrs['src'] Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
HTML tags may have attributes , for example
<img src="ball.png" title="A big ball"> Here the <img> has 2 attributes: src and title .
The src attribute has the value ball.png , the title attribute has the value A big ball .
tag.attrs is a dictionary of all attributes of the tag tag , and
And so your
tag.attrs['src'] this is the src attribute value of your tag (stored in the tag variable).
Source: https://ru.stackoverflow.com/questions/881013/
All Articles
attrsattribute of an object that is in the variabletag- andreymalattrsis the name of the attribute. In itself, it means absolutely nothing - it is just a set of letters. - andreymaltagvariable - we do not know. If this is your code, then you should know :) - andreymal