Reputation: 51
Ok, here is a brief description of problem I'm trying to find a solution for.
Let's say we have an online service that can automate different online tasks (clicking on a link, navigate to the page, choose an option from a combo box and finally copy the address from address bar). The site that I want to perform these actions on is completely in JavaScript and I want everything to be at the PHP endpoint I mean a php script get parameters from users, pass it to JS Server and retrieve the result and show it back to the user.
How could such a scenario be done? Any idea? I know that it can be done by analyzing DOM elements in details but its very very time consuming and volatile. Just want to know is there any way so I can record that action like what we can do with Selenium? What about that php <-> Headless browser interaction?
Upvotes: 4
Views: 2322
Reputation: 11414
For the manual recording part of the question, The CasperJS + resurectio Chrome extension combo is really convenient.
Upvotes: 7
Reputation: 25782
In your scenario, where the web context that you are trying to crawl includes JavaScript, CasperJS is an excellent option. You can use it to trigger events, add process steps, include functions to wait and validate after each ajax call before to process any next step.
Here an example about how use casperjs using Javascript and jQuery.
CasperJs and Jquery with chained Selects
Here an example about how you can set casperjs as service in order to pass data to PHP.
CasperJS passing data back to PHP
Upvotes: 1