I want to examine a button that leads to downloading a file. the HTML contains:
<a class="calibre-push-button " href="/calibre/get/EPUB/123/calibre" role="button" title="Download this file" download="a.txt"><svg style="fill: currentColor; height: 2ex; width: 2ex; vertical-align: text-top"><use xlink:href="#icon-cloud-download"></use></svg><span> Download</span></a>
I want to write a python code to download the file (click on the button) and save it. I started working with Selenium, but hit the wall. This is what I've done:
from selenium import webdriver
driver=webdriver.Chrome(executable_path='chromedriver')#,chrome_options=options)
driver.get('http://website.address.com')
gotit = driver.find_element_by_xpath("//a.calibre-push-button [contains(text(),'')]")
I want the gotit
element to store the button optionally and allow gotit.click()
.
Any ideas?
asked Dec 30, 2022 at 19:24
-
1Welcome to the community @omerbp. I guess, you can answer or working solution sqa.stackexchange.com/questions/50798/…Narendra Chandratre– Narendra Chandratre2023年01月02日 06:09:59 +00:00Commented Jan 2, 2023 at 6:09
-
Thanks. Haven't been able to solve it so far though, this subject is well beyond my expertiseAvidLearner– AvidLearner2023年01月03日 15:28:33 +00:00Commented Jan 3, 2023 at 15:28
default