Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
HTML Attributes | Getting Acquainted with HTML
Web Scraping with Python
course content

Conteúdo do Curso

Web Scraping with Python

Web Scraping with Python

1. Getting Acquainted with HTML
2. Beautiful Soup: Part I
3. Beautiful Soup: Part II

bookHTML 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?

Which attribute do we use for the hyperlink?

Selecione a resposta correta

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 5
some-alt