0

I am trying to copy paste some stuff from some website which I want to automate. Here is my manual workflow:

  1. There is a master webpage which contains set of links.
  2. When I click on one of those links it opens another (say topic page) page with set of tabs.
  3. I click on one specific of those tabs which loads a page containing several buttons with same html-css applied to them.
  4. On click events of those botton calls a javascript function passing four integer parameters.
  5. The function results in generating a separate popup window with some small content which I then print as pdf.

The issue is that the website blocks right click and text selection. And the popup window contains a image which I print as pdf by right clicking on titlebar and selecting print as pdf. When I checked the source of popup, I found that it uses

"data:image/png;base64,<source for image>"

as value for src of <image>.

Now the big question can I write some script which can run when either master page or topic page to automatically click on buttons on them and get those images saved either directly as png or pdfs? I am good at programming languages java, groovy, python, C#... Also explored javascript a lot. But that's many years ago and really lost in touch with JS. Can I do this with say greasemonkey or any other way. Any pointers (possibly detailed) will be helpful...Or even some small pseudocode which I can paste in console of topic page which will do all clicking of buttons and saving image from the popup, so that I don't have to do button-clicking-&-saving-image manually. This will also serve a lot since there are more buttons per topic page instead of number of topic pages themselves.

Update

Well I know this question is not at all specific, so here is my initial hurdles, since I have started to try it out: given that I am programmatically call all those function on onclick events, how can I get hold of popups in source? That is, how can I reference the popup that is opened by function call in js?

MsA
  • 2,599
  • 3
  • 22
  • 47
  • 2
    Is it possible, sure. There really isn't any way for us to help you without seeing what the page looks like though. (And even then, this question is probably too broad.) – Gerrit0 Feb 11 '17 at 15:58
  • how do I get hold of popup window opened by js function. Its returning `undefined`, so that I may call some save as or print as pdf on it? – MsA Feb 11 '17 at 16:29
  • Take a look at [this question](http://stackoverflow.com/questions/6340160/how-to-get-the-references-of-all-already-opened-child-windows) – Gerrit0 Feb 11 '17 at 16:45
  • You need to provide links or a mockup (an MCVE). Also [DownThemAll](http://www.downthemall.net/) might work for you. It can grab select images across multiple tabs, simultaneously. – Brock Adams Feb 11 '17 at 22:17
  • downthemall requires link target to be a file. In my case clicking buttons open runs a javascript function which loads a window popup which in turn contain a desired images. So no single page does not contain links to all images. Its the js which is opening a popup loaded with image. – MsA Feb 12 '17 at 19:11

0 Answers0