Skip to content

Instantly share code, notes, and snippets.

@luckylittle
Last active September 22, 2020 11:21
Show Gist options
  • Save luckylittle/979ef0eb8d04e8f8b8c14984d3c9a86c to your computer and use it in GitHub Desktop.
Save luckylittle/979ef0eb8d04e8f8b8c14984d3c9a86c to your computer and use it in GitHub Desktop.
Super easy hyperlink extractor for local HTML
#!/bin/python3
from bs4 import BeautifulSoup
import os
file = open("audible.html", "r")
html_doc = file.read()
soup = BeautifulSoup(html_doc, 'html.parser')
for link in soup.find_all('a'):
print(link.get('href'))
file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment