Last active
February 3, 2023 02:42
-
-
Save fastfingertips/aed60b24c310c78a00828ac36bef669c to your computer and use it in GitHub Desktop.
extract URL from HTML Page using BeautifulSoup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
inputUrl = input('Enter the url: ') | |
urlReq = requests.get(inputUrl) | |
reqData = urlReq.text | |
dataDom = BeautifulSoup(reqData) | |
domLinks = dataDom.find_all('a') | |
for linkNo, link in enumerate(domLinks): print(linkNo,link.get('href')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment