Try to search your question here, if you can't find : Ask Any Question Now ?

Lua/Splash: Link to next page is not being executed

HomeCategory: stackoverflowLua/Splash: Link to next page is not being executed
julie asked 2 weeks ago

I am trying to write a Lua script to go to the next page of the website: http://quotes.toscrape.com/js/page/1/

My script:


    function main(splash, args)
      assert(splash:go(args.url))
      assert(splash:wait(0.5))
      assert(splash:runjs('document.querySelector(".next a[href]").click()'))
      splash:set_viewport_full()
      return {
        html = splash:html(),
        png = splash:png(),
        har = splash:har(),
      }
    end

I tried multiple CSS Selectors which all work in the browser. However the Lua script only returns the first page and doesn’t open the next.

Does anyone have an idea what could be the cause?

Thank you and best regards
Tobi

1 Answers
Best Answer
Amit answered 2 weeks ago
Your Answer

20 + 13 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com