Last active
May 26, 2019 01:45
-
-
Save onlurking/ad58a7c25bcbcc996178 to your computer and use it in GitHub Desktop.
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 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