peerigon / phridge

A bridge between node and PhantomJS
The Unlicense
519 stars 50 forks source link

Example of How I submit a form and wait for the response? #6

Closed bigattichouse closed 9 years ago

bigattichouse commented 10 years ago

I'm able to form fill in

jQuery("username").val("foo") ...

but if I do click() or tigger(click) or even submit the form ... how do I know it loaded a new page. I see the OnPageLoaded event - but it doesn't seem to ever fire.

could you create an example of something that inputs into a form and clicks submit, and then proceeds on the next page?

jhnns commented 10 years ago

This question is more related to PhantomJS than to phridge. You'd face the same problem if you'd just use PhantomJS, but afaik the pageLoaded-event is only fired the first time. You probably need to use setTimeout or a polling technique via setInterval.

But you should probably check if CasperJS fits better to your needs.

bigattichouse commented 10 years ago

I think my strategy is to wrap some of the "page loaded" and other events, and transmit those back via text output.. then catch those.

On Sun, Aug 3, 2014 at 6:25 AM, Johannes Ewald notifications@github.com wrote:

This question is more related to PhantomJS than to phridge. You'd face the same problem if you'd just use PhantomJS, but afaik the pageLoaded-event is only fired the first time. You probably need to use setTimeout or a polling technique via setInterval.

But you should probably check if CasperJS http://casperjs.org/ fits better to your needs.

— Reply to this email directly or view it on GitHub https://github.com/peerigon/phridge/issues/6#issuecomment-50988037.

jhnns commented 10 years ago

You could also try the onNavigationRequested- or the onUrlChanged-event.

jhnns commented 10 years ago

Can this be closed?

bigattichouse commented 10 years ago

I suppose so.. I may reopen it (with other detail questions) when I get a chance to revisit the project.

On Fri, Aug 22, 2014 at 12:51 PM, Johannes Ewald notifications@github.com wrote:

Can this be closed?

— Reply to this email directly or view it on GitHub https://github.com/peerigon/phridge/issues/6#issuecomment-53096571.