0

The following code ...

splash:evaljs('document.querySelectorAll("iframe.iframe-container.js-oddset-game-iframe")[0].contentDocument.querySelectorAll("td.leftText a.eventLink").length')

... returns 8 - i.e. there are 8 nodes in the array.

However, when I then try to return the nodeList (array) directly, the result is nil? Obviously a table should be returned since an array is returned from the javascript code.

Is this a bug in Splash? Can't Splash handle access to elements in iframes? I have the --js-cross-domain-access option on too.

Patrick
  • 5,526
  • 14
  • 64
  • 101

1 Answers1

0

It is not a bug. iframes are only available when you use the render.json endpoint with the iframes=1 parameter. When you use that you cannot run a custom Lua script.

Refer to the documentation: https://splash.readthedocs.io/en/stable/api.html#render-json

And this answer: https://stackoverflow.com/a/44682917/4082726

malberts
  • 2,488
  • 1
  • 11
  • 16