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

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -