1

I want to use CutyCapt to capture the web page

https://eresearch.fidelity.com/eresearch/landing.jhtml#

However, before capturing there is one tab out of three that should be selected to get the screen I want to capture, as seen in the partial image that I have linked below.

The question is, how can I get CutyCapt (or a similar standalone tool) to click the tab I want before performing the webpage capture?

Click here to see what the web page looks like after properly selecting the tab marked "Orders by Fidelity Customers".

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
reikred
  • 151
  • 7

2 Answers2

0

take a look at Wraith, especially at the beforeCapture hooks section, it may be helpful for what you are trying to achieve with cutycapt.

William J.
  • 1,574
  • 15
  • 26
  • Will this work when the clickable buttons on the target website are not adressable via some URL? On the website I am referring to (see original post) there is no URL being displayed when I hover over the button I wish to click before the capture. NOTE: I have read the manual section you referred to, and I got the impression that an "adressable" button is required. – reikred Feb 23 '16 at 23:54
  • Hi. Using the beforeCapture hook you can run an arbitrary JS code, so you could do something like this: (supposing you're using jQuery in your site) `$('#fidelity-orders-tab > a').click()` before the tool captures the screenshot – William J. Feb 24 '16 at 09:57
0

If you're committed to using CutyCapt for this and don't mind doing a little extra research and playing around with your favourite web-server, the easiest way to do this is to fetch the page via a local proxy that will inject some Javascript code that will click the tab after a certain amount of time. Then you would set CutyCapt to delay taking the screenshot by an appropriate amount of time so that your code has a chance to execute.

Basically you'd just configure your web server (Apache, Nginx, etc) to replace </body> with the following code:

<script>
    document.getElementById('fidelity-orders-tab').children[0].click()
</script></body>

Replacing the </body> tag means you don't have to worry about the DOM being loaded and such but they already use jQuery on that page so there'd be no real harm of taking advantage of the library. You could even use a setTimeout() call if you wanted it to only run after some other AJAX work is done by the page.

Then when you invoke CutyCapt, you make it wait a bit by using the --delay argument.

jeteon
  • 3,471
  • 27
  • 40