How to download a pdf with Celerity when the download link is a javascript function?

StackOverflow https://stackoverflow.com/questions/5905757

  •  29-10-2019
  •  | 
  •  

Question

link looks like this:

    <a onclick="SmartScroller_GetCoords(); openPopup('CaseSearchServlet?_=gyRWOWiixsI4V5mQbu4YDfu9rnZGrO3VQ%2FFvGdRRaSOaCi7%2F9t4X1xttTQ7FK8J6TbhndUjs0vpd%0AZPSDQFaHbLZJ%2FLMVJyeZ', 'History0' , 480, 700);setTimeout('SmartScroller_Scroll()', 2000);" href="#">090416487</a>

I can't do:

    browser.link(:id, 'pdf').download #=> #<IO:0x11ce78c>

Because there is no href or any other attribute to refer to, but I can get the full url of the download link. So I can do:

    browser.goto("download link here")

but I get:

    Celerity::Exception::UnexpectedPageException: application/pdf

Any idea how to this?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top