course content

Course Content

Web Scraping with Python

HTML attributesHTML attributes

If you want to provide additional information about HTML elements, you should use attributes. Attributes must be specified within a starting tag, usually in pairs: name="value".

For instance, if you want to insert a picture, you should use the <img> tag with the src attribute. The value of this attribute is the link to a picture.

For example,

will display the following picture. Note that <img> is a self-closing tag, meaning it doesn't need a closing tag.

Another popular tag always comes with an attribute is the anchor <a> tag. It is used to create hyperlinks, and the link the text should be led to must be set within the href attribute. For instance,

will return Test page. There we also set the target parameter to '_blank' so that pressing on the link will open the page in a new tab.


Which attribute do we use for the hyperlink?

Select the correct answer

Section 1.

Chapter 5