Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zombie.js Click Javascript Link

I use Node.js along with Zombie.js for scraping. On some pages, I need to click a Javascript link

Here is the example of the page

http://www.indotrading.com/company/berkat-jaya-electronics.aspx

And the part that I want to click is <a class="showme".. > </a>, which calls a javascript. How can I do it using Zombie.js? Or is there any alternative to Zombie.js that can handle javascript link?

like image 506
CherryBelle Avatar asked Nov 18 '25 15:11

CherryBelle


1 Answers

You can use browser.clickLink to do this. The selector can be your class or the link text, whichever is specific enough for your situation:

browser.clickLink(".showme", function(err, browser, status) {
  //link has been clicked and actions processed
});
like image 123
mr.freeze Avatar answered Nov 20 '25 05:11

mr.freeze



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!