Using Chrome as a slave app?

Just starting out? Need help? Post your questions and find answers here.
Seymour Clufley
Addict
Addict
Posts: 1233
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Using Chrome as a slave app?

Post by Seymour Clufley »

I've been writing a PB program that employs a webpage to do some SVG geometry calculations. The webpage is run inside the webgadget, allowed time to do its calculations and deposits the result into the HTML body, and then the current HTML code is scooped out by the PB app and the result data extracted from it. This system works, but there's one problem: the webpage was coded for Chrome, not Internet Explorer (which is used by PB's webgadget) and IE does SVG calculations differently. So a webpage which worked perfectly in Chrome, fails to do its job when run in PB's webgadget.

The goal, then, is to get PB to open a webpage in Chrome, then wait a few seconds and strip the current HTML from Chrome.

It would be easy to get Chrome to run the webpage. The difficult bit would be retrieving the current HTML from it a few seconds later. One option would be to have the webpage save the results to a local file, but that could not be automated.

Does anyone have any ideas?
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Seymour Clufley
Addict
Addict
Posts: 1233
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: Using Chrome as a slave app?

Post by Seymour Clufley »

Actually I've solved it, by getting Chrome to automatically trigger a download of the required data as a .txt file. The PB app simply watches the Downloads folder and waits for a new file to appear.

Programming is hilarious sometimes.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Post Reply