1

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>&nbsp;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
2
  • 1
    Welcome to the community @omerbp. I guess, you can answer or working solution sqa.stackexchange.com/questions/50798/… Commented Jan 2, 2023 at 6:09
  • Thanks. Haven't been able to solve it so far though, this subject is well beyond my expertise Commented Jan 3, 2023 at 15:28

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.