Simple python script to get all hyperlink for a URL,
Save following script in a file name called app.py
import requests
from bs4 import BeautifulSoup
response = requests.get("https://www.goglides.dev")
soup = BeautifulSoup(response.content, 'html.parser')
links = soup.find_all('a')
for link in links:
href = link.get('href')
print(href)
Make sure to install all dependencies before you run this python code.
pip install requests beautifulsoup4 selenium
Finally run the code as follows,
python app.py
Output:
...
/contact
/code-of-conduct
/privacy
/terms
https://twitter.com/go_glides
https://facebook.com/goglides.dev
https://instagram.com/goglides
...
Top comments (0)