0

I'm using ZombieJs for web scraping, what I'm trying to is that when it clicks an element it would display html element of a new page but right now it returns nothing.

const Browser = require('zombie');

Browser.visit(("url"), function(error, browser){
   const Search = browser.querySelector("#resultlink_1");
   browser.click(Search);
   console.log(browser.html());
})
Gregor
  • 29
  • 5
  • Maybe you have to wait for the new page to load? – jabaa Aug 19 '22 at 10:09
  • By default zombieJs waits till everything is loaded ,but I used setTimeout() and it didn't help – Gregor Aug 19 '22 at 10:27
  • Can you post a [mcve] containing the target website? – jabaa Aug 19 '22 at 10:29
  • if I use browser.dump it shows that in history that it was redirected, but when I need to use any element from a new page it says No open window with an HTML document. – Gregor Aug 19 '22 at 15:42

1 Answers1

0

Switched from ZmobieJS to Puppeteer and everything works perfectly.

Gregor
  • 29
  • 5