Error when capturing multiple URLs #63

Open
norm opened this Issue Feb 7, 2014 · 5 comments

Projects

None yet

4 participants

@norm
norm commented Feb 7, 2014

When capturing multiple URLs from one instance of webkit2png, the following error occurs:

Python[10560:1107] *** WebKit discarded an uncaught exception in the webView:didFinishLoadForFrame: delegate: <NSUnknownKeyException> [<DOMAbstractView 0x7ff0650d3b30> valueForUndefinedKey:]: this class is not key value coding-compliant for the key webkit2png.

Have tracked it down to the new Webkit2PngScriptBridge. With the code for that commented out, it works fine.

@norm
norm commented Feb 7, 2014

(cc @spicyj as the original author of that)

@paulhammond
Owner

I'm actually considering removing the ability to capture multiple urls in one webkit2png instance - it makes the code a lot messier, I'm fairly sure it's the source of a lot of bugs like this, it makes error handling difficult for calling scripts (because the entire process crashes when one url breaks) and it's not much easier than just using a bash for loop or similar.

On the other hand, it is slightly slower (although I haven't benchmarked this).

Thoughts?

@norm
norm commented Feb 11, 2014

I always used to capture one at a time, so this wouldn't upset me.

@norm norm added a commit to alphagov/webkit2png that referenced this issue Feb 18, 2014
@norm norm Remove ability to capture multiple URLs
As discussed in paulhammond#63,
webkit2png might be better capturing just one URL at a time.
7fc3be6
@RSully
RSully commented Mar 5, 2014

I'd say we should strip out multiple URL support. The complexity isn't worth the limited functionality. It would be easy enough to add another script that takes a bunch of URLs and any webkit2png options and launches n processes, if someone really wanted out-of-the-box functionality.

@bschneider45701

@norm: Could you please provide more detail on what you commented? I have a need to process multiple URLs without the added slowdown of re-initializing WebKit. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment