Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

350
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda