Contenido del Curso
Web Scraping with Python
Web Scraping with Python
HTML Attributes
When including additional information about HTML elements, you should use attributes. Attributes are specified within an opening tag, usually in the form of name="value"
.
For example, to embed an image, use the <img>
tag with the src
attribute. The value of this attribute should be the URL of the image.
Here is an example:
This code will display the specified 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 <a>
(anchor) tag. It is used to create hyperlinks, and you must specify the link destination within the href
attribute. For example:
Will return a link to the Test page.
The target
parameter is set to '_blank'
, ensuring that clicking the link opens the page in a new tab.
¡Gracias por tus comentarios!