Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

349
Views
Scrapy Splash Lua Script not rendering JavaScript

I'm having trouble clicking Load More button on the bottom of https://cointelegraph.com/tags/ethereum website. I am able to get 15 articles from the first page, but that's about it. My Lua script looks like this:

function main(splash, args)
  splash.images_enabled = true
  assert(splash:go(args.url))
  assert(splash:wait(5))
  for i = 0,5,1
  do
    input_box = assert(splash:select("button[class='btn posts-listing__more-btn']"))
    assert(splash:wait(1))
    input_box:mouse_click()
    assert(splash:wait(5))
  end
  splash:set_viewport_full()
  return {
    png = splash:png(),
    html = splash:html(),
    har = splash:har(),
  }
end

What I also tried, is executing this code inside Lua Splash script:

assert(splash:runjs('document.querySelectorAll("button.btn.posts-listing__more-btn")[0].click()'))

What's interesting is that document.querySelectorAll("button.btn.posts-listing__more-btn")[0].click() executed inside Chrome console, clicks on the button just fine. I am aware at this point that the website in question enforces some measures to prevent scraping, or JavaScript execution, but I can't figure out what. I also tried launching splash with --disable-private-mode, enabling settings like Flash, Local storage, HTML5, and anything else I found to be possible solution but nothing works. Initially my spider was scraping https://cointelegraph.com/search?query=ethereum but that URL doesn't even load the articles with Splash any longer. Any hints, or help is greatly appreciated! Using Splash version: 3.5.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!