Automating web entry/printing in a form

Didn't see anything that seemed to really fit this, so new thread and all. Put simply, I have been asked to do a thoroughly asinine task in the closing days of my job; we're archiving a system, and have several thousand bug records they want opened up individually on a web page, printed to PDF via Cute PDF, and then saved somewhere. This could not be a dumber idea and, when I pointed out our CM group should just be able to write a query to do it, I was told CM's time is too valuable and that I couldn't have actual access to the bug record system to try to write my own queries and/or reports.

I will say it again, these are the closing days of my job, and I could not be happier.

I would tell them to bite me, but this task has been assigned to several of us exiting employees, and, if I don't do it, they will, because . . . I don't really know, but I actually like these people and don't want them to be screwed by this pointless task. So, anyways, I want to open up a form, enter a numeric value, and have it open the page and auto-print to a PDF. I've never messed with automating Firefox, and I've spent about ten minutes messing around with iMacro before deciding to take the lazy route and just post here. I can get iMacro to do most of what I want, but saving it as a new filename (the default is just a generic "bug.cgi", and I don't want to mess with it each time).

So, what I want to do is type in an identifier, have it pull up the record and print it to PDF as that same identifier. I would then just need to enter in the ID and let the automation script run. Even better, pull each ID from a .csv file or something, but typing wouldn't be THAT bad.

Anyways, anyone got an idea for me on this?

Are they mad at you for leaving? Sounds like a BS task to make your life difficult. Putting them in PDF format has got to be the worst idea ever; they can no longer do anything with the data once it's in that format. I can see why you're happy to get out of there.

I think I'd probably be looking into using Windows Script Host to drive either IE or Firefox to navigate to the pages and print them.

You should be using PhantomJS

It's a headless web browser that can capture the contents of the page in memory to an image or PDF file. To save a wikipedia article to a PDF file you can use one of their example scripts on the command line to do the following:

phantomjs rasterize.js 'http://en.wikipedia.org/w/index.php?title=Jakarta&printable=yes' jakarta.pdf

If the URLs from your system are fairly simple, then you should be able to easily loop over and export your bug reports from there.

it would be a pain in the ass to try to archive it even without all the legal requirements they're insanely trying to ignore.

Honestly, I think you should be whistleblowing to the FDA on this. Those laws exist for a reason.

You know, never mind.

Malor wrote:
it would be a pain in the ass to try to archive it even without all the legal requirements they're insanely trying to ignore.

Honestly, I think you should be whistleblowing to the FDA on this. Those laws exist for a reason.

Went ahead and did some deleting of the earlier post. Basically, I've made a very conscious effort to have my online life and work life separate, and, even though I'm leaving soon, I think it's better to continue that and not curse any too specifically.

As for FDA concerns, I don't think there's going to need to be a whistleblower of any sort; the FDA makes regular visits to say "hi", and I'll gladly be away when that happens.