0

Website: https://myir.ird.govt.nz/eservices/home/?link=RWTEXREG

I'm attempting to download this file. It looks like the request is handled server side so there isn't any download link per se.

I've tried a bunch of things, including:

result = driver.find_element_by_xpath("//span[contains(@class,'CaptionLinkText')]").text

But I really feel like I'm out of my element (no pun intended) with this.

3
  • If you're going to downvote a question, it would help to leave a comment so I can improve.
    – Ed Baker
    Nov 2, 2021 at 23:49
  • Maybe the downvote is due to not liking puns? I don't know, puns are fun!
    – Lee Jensen
    Nov 3, 2021 at 16:04
  • @LeeJensen lol!
    – Ed Baker
    Nov 4, 2021 at 2:29

1 Answer 1

0

Try driver.find_element_by_xpath('//*[text()="Download"]')

This says, "starting anywhere //, give me any element *, whose [], text()="Download". Note that text is a function and not an attribute.

You can test the selector by opening [F12] DevTools going to the "Elements" tab, and doing ctrl+f to open the input to try things out.

I keep this handy for XPATH: https://devhints.io/xpath

1
  • Thanks, I'll give it a go tomorrow and if all is good I will mark it with the tick
    – Ed Baker
    Nov 4, 2021 at 2:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.