Comment télécharger un pdf avec Celerity lorsque le lien de téléchargement est une fonction javascript ?

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

  •  29-10-2019
  •  | 
  •  

Question

le lien ressemble à ceci :

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

Je ne peux pas faire :

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

Parce qu'il n'y a pas de href ou tout autre attribut auquel se référer, mais je peux obtenir l'URL complète du lien de téléchargement.Je peux donc faire :

    browser.goto("download link here")

mais j'obtiens :

    Celerity::Exception::UnexpectedPageException: application/pdf

Une idée de comment faire ?

Pas de solution correcte

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top