CasperJS click event having AJAX call

后端 未结 1 1152
野趣味
野趣味 2020-12-10 09:23

I am trying to fetch data from a site by simulating events using CasperJS with phantomJS 1.7.0.

I am able to simulate normal click events and select events. But my c

相关标签:
1条回答
  • 2020-12-10 10:07

    I had the same problem today. I found this post, which put me in the direction of jQuery.

    After some testing I found out that there was already a jQuery loaded on that webpage. (A pretty old version though)

    Loading another jQuery on top of that broke any js calls made, so also the link that does an Ajax call.

    To solve this I found http://api.jquery.com/jQuery.noConflict/

    and I added the following to my code:

        this.evaluate(function () { jq = $.noConflict(true) } ); 
    

    Anything that was formerly assigned to $ will be restored that way. And the jQuery that you injected is now available under 'jq'.

    Hope this helps you guys.

    0 讨论(0)
提交回复
热议问题