course content

Course Content

Web Scraping with Python

HTML AttributesHTML Attributes

If you wish to include additional information about HTML elements, you should employ attributes. Attributes must be specified within an opening tag, typically in pairs: name="value".

For example, when you want to embed an image, you should utilize the <img> tag with the src attribute. The value of this attribute should be the link to the image.

For instance:

This code will display the following image. Note that the <img> tag is self-closing, meaning it doesn't require a closing tag.

Another commonly used tag that always includes an attribute is the anchor <a> tag. It is used to create hyperlinks, and you must specify the link destination within the href attribute. For example:

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

Everything was clear?

Section 1. Chapter 5