Woohui Kim
Woohui Kim

Reputation: 3

Python Automatic Download (ufile.io)

I am creating a program that automates downloading my business files from ufile.io. I am using selenium to automate downloading. (By the way, I'm a beginner at python, so I don't know how to perform click on the button). I am using python 3.9.1

Link of (test) file: https://ufile.io/hogllf5z (Expires in 30 days)

Code:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time

ChromeDriver = "/Users/macintosh/Python 3rd party library/chromedriver"
driver = webdriver.Chrome(ChromeDriver)

driver.get("https://ufile.io/hogllf5z")

try:
    element = WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.XPATH, "/html/body/div[10]/div[4]/div/section/div/div/div/div/a[2]"))
    )
except:
    driver.quit()

Upvotes: 0

Views: 377

Answers (1)

Ryan
Ryan

Reputation: 384

You cannot use selenium to automate downloads from ufile.io as it uses tools to prevent bots.

You can use the api to download files if you subscribe to a business plan.

Disclosure: I'm the founder

Upvotes: 1

Related Questions