I have a small scraper where I need to click the anchor link using JavaScript. I tried several ways: jQuery.click() , document.createEvent('MouseEvents') , etc. They all worked, but they are not fully executed as a human click (they open the tab as they should, but they do not start the download).
An anchor tag has this attribute:
onclick="if (document.getElementById('ReportViewer_ctl01_ctl05_ctl00').selectedIndex == 0) return false; if (!ClientToolbarReportViewer_ctl01.HandleClientSideExport()) __doPostBack('ReportViewer$ctl01$ctl05$ctl01','');return false;"
I also tried running it on the command line:
__doPostBack('ReportViewer$ctl01$ctl05$ctl01','')
it is also a kind of work, but not completely like a flick of a person.
I can tell you in detail if necessary, but at the moment I'm looking for a magic bullet, which, I think, should exist.
source share