Is there anyway of forcing a javascript GET request before rendering html with Splash?

Viewed 34

I'm getting stucked loading a dynamic content from this website with Splash:

https://www.fravega.com/l/tv-y-video/tv/?categorias=tv-y-video%2Ftv&page=1

I'm trying to get the href attribute from this element: <a data-type="next" data-active="false" data-test-id="pagination-next-button" href="/l/tv-y-video/tv/?categorias=tv-y-video%2Ftv&amp;page=2" class="sc-efd39989-3 eHIrnc" style="pointer-events: unset;"><span>Siguiente &gt;</span></a> into render.html, but since it's generated by javascript I can't find a way to tell Splash to run it in its scripts panel

function main(splash, args)
    assert(splash:go(args.url))
    assert(splash:wait(0.5))
    return {
        html = splash:html(),
        png = splash:png(),
        har = splash:har(),
    }
end

I've tried every solution that Splash FAQs suggests, but it didn't render it yet

Here is my environment:

  • OS: Ubuntu 22.04.1 LTS
  • Docker image: scrapinghub/splash::latest

If anyone could help me, I'd be really thankful

PD: The solution should be Python/Scrapy friendly because this response should be generated from a scrapy spider! But allow me to do that work

0 Answers
Related