node-scraper icon indicating copy to clipboard operation
node-scraper copied to clipboard

Remote error: TypeError: Cannot read property '_ownerDocument' of undefined

Open gaara87 opened this issue 13 years ago • 1 comments

I have two nested scraping calls, and this is thrown on the second one. Unfortunately, this seems to be happening only recently.

Would be great if you can find out whats happening.

To start of with, i can tell you the execution does not cross line 59:scraper.js because $(body) throws the error that i've pasted as the title. (Again, this happens only in the second nested call, not in the first one)

gaara87 avatar Aug 16 '11 13:08 gaara87

Hi, I encountered a similar issue. I don't get an error message, but the second scraping call only gets executed once and somehow too late. I'm new to both javascript and node.js and I don't understand this behaviour.

Example:

scraper(url, function (e, $) {
    // find links
    $('x').each(function (i, el) {
        scraper(detail, function (e, $) {
            // this gets only called once
            // after the each iteration completed
            // instead, I wanted it to be called
            // for every link
        });
    });
});

Why is that? Thanks.

kaikuehne avatar Aug 17 '11 22:08 kaikuehne