I am trying to click on a hyperlink to download a file on a webpage. The HTML shows that it is javascript.
I tried links from StackOverflow and more than four hours worth of research prior to that to no avail.
Here's the latest iteration of my code.
Dim l
For Each l In HTMLdoc.getElementsByTagName("a")
If l.innerText = "Comma Separated Value (CSV)" Then
l.Click
Exit For
End If
Next l
Here's the HTML for the element I'm trying to click.
<a style="color:#0000FF" href="javascript:JTRANSUM('https://www.merchantconnect.com/CWRWeb/download.do?','CRTRNRPT','1','950******4','01-OCT-2019','03-OCT-2019','7','1216','64***','NONE','0','Z216******','4616**********','Z216******','MID','HIGHEST','CARD_TYPE','HIGHEST','CARD_NBR','HIGHEST','lb4******','N','0','8755***********','COMT');">Comma Separated Value (CSV)</a>
I would like to click on this link by using the text "Comma Separated Value (CSV)".