Python BeautifulSoup: Find the href of the first <a> tag of a given html document
Write a Python program to find the href of the first <a> tag of a given html document.
Sample Solution:
Python Code:
Sample Output:
href of the first <a> tag: https://www.w3resource.com/html/HTML-tutorials.php
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a Python program to find the text of the first <a> tag of a given html text.
Next: Write a Python program to extract all the URLs from the webpage python.org that are nested within <li> tags from .
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.