I have a page with a simple form. This form has ONE input text.
I have this code:
page.open("http://www.example.com", function (status) { page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js", function() { page.evaluate(function() { $('input[name=myText]').val('my content'); }); }); });
(as you can see, I also downloaded jquery)
Now, when I set the contents of this input text, the page changes, the contents of the page change.
My question is: how can I get updated content? The problem is that I need to submit the form, but I cannot do it after:
$('input[name=myText]').val('my content');
because when I installed it, the JS event on the page changes, which changes the content.
SO I have to read the new content, find the form using jQuery and then submit it.
Can someone help me?
Thanks!
source share