Skip to content

Instantly share code, notes, and snippets.

@pourya2374
Last active October 31, 2019 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pourya2374/87fb661a12c210bd604519c98b11f4ef to your computer and use it in GitHub Desktop.
Save pourya2374/87fb661a12c210bd604519c98b11f4ef to your computer and use it in GitHub Desktop.
from bs4 import BeautifulSoup
source = str(open('page_source.html', 'r').readlines())
soup = BeautifulSoup(source, 'html.parser')
output = open('links.txt', 'w')
for a_tag in soup.find_all('a', string="DOWNLOAD"):
output.write(a_tag['href'] + '\n')
output.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment