[Python] Is splash:select different from document.querySelector?

Discussão em 'Python' iniciado por Stack, Junho 19, 2025.

  1. Stack

    Stack Membro Participativo

    example link https://www.anytimemailbox.com/s/new-york-42-broadway

    function main(splash)
    local button = splash:select('div[class="t-disc"]>a')
    assert(button) -- fail
    end


    But in the F12 developer tool console

    >> document.querySelector('div[class="t-disc"]>a')
    <a href="#" onclick="thShowFullServicePlan11(4967);return false;">Full Details</a>


    The doc https://splash.readthedocs.io/en/stable/scripting-ref.html#splash-select says


    Using splash:select you can get the element that matches your specified CSS selector like using document.querySelector in the browser.
    ​

    Is there some corner case where splash:select is different from document.querySelector? If so, is there one workaround?

    Continue reading...

Compartilhe esta Página