Skip to content

Instantly share code, notes, and snippets.

@onlurking
Last active May 26, 2019 01:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onlurking/ad58a7c25bcbcc996178 to your computer and use it in GitHub Desktop.
Save onlurking/ad58a7c25bcbcc996178 to your computer and use it in GitHub Desktop.
from selenium import webdriver
from bs4 import BeautifulSoup, SoupStrainer
from time import sleep
browser = webdriver.Chrome()
browser.get("https://volafile.io/r/kUFzLJ")
sleep(4)
element = browser.find_element_by_tag_name("div")
element = element.get_attribute('innerHTML')
browser.close()
soup = BeautifulSoup(element, "html.parser", parse_only=SoupStrainer('a'))
f = open('url.tx','w')
for link in soup.findAll("a", {"class":"file_name"}):
url = link.get('href', link.get_text())
f.write(url + "\n")
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment