Getting the name of file download using selenium in python -



Getting the name of file download using selenium in python -

so i'm downloading file using selenium , works fine need name of file.

my variable path should name of downloaded prints out "none".

driver = webdriver.firefox(firefox_profile=profile, firefox_binary=binary) driver.get("stuff") time.sleep(2) path = driver.find_element_by_xpath("//a[contains(text(), 'tgz')]").click() print path

first link object, can stuff it:

link = driver.find_element_by_xpath("//a[contains(text(), 'devcrt.sp1')]")

then "href" attribute link object:

path = link.get_attribute("href") #this homecoming 'www.booger.com/file.exe'

then click on link object:

link.click()

python selenium

Comments

Popular posts from this blog

php - How to pass multiple values from url -

php - Laravel not returning controller -

c# - Confused on how to specify a Platform and Version while using ChromeOptions for RemoteWebDriver with Selenium donNet since recent updates -