Can Zombie.js be used to get HTML of newly open window by window.open?

615 views
Skip to first unread message

Abhishek Trivedi

unread,
Oct 16, 2014, 2:21:00 AM10/16/14
to zomb...@googlegroups.com

I am trying to get html of newly open window after activating a link that uses javascript by zombie.js.

Here is the html code

<html>
<head>
    <script type="text/javascript">
        function newin(id)
        {
            var url="page.php?id="+id;
            window.open(url,id,"toolbar=no,location=top,directories=no,status=no,scrollbars=yes,hscroll=no,resizable=yes,copyhistory=no,width=1025,height=1250");
        }
    </script>
</head>

<body>
    <div>
        <a href="javascript:newin(123)">123</a><br/>
        <a href="javascript:newin(234)">234</a><br/>
        <a href="javascript:newin(345)">345</a><br/>
    </div>
</body>
</html>


The Script I am using is:

var Browser = require("zombie"); var browser = new Browser(); browser.visit("http://localhost:8000/testpage.html", function () { browser.wait(function(){ var selector = "a[href*='newin']"; var elements = browser.queryAll(selector); for (var e=0;e<elements.length;e++){ browser.clickLink(elements[e],function(){ browser.wait(function(){ console.log(browser.html()); }); }); } }); });

I am not able to get HTML of any window.Any ideas what is wrong in this code ?

as...@labnotes.org

unread,
Oct 16, 2014, 11:54:11 AM10/16/14
to zomb...@googlegroups.com
There’s no support for javascript: links, see:


--
You received this message because you are subscribed to the Google Groups "zombie.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zombie-js+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages