Question

I'm currently using curl to login to a site and grab the html for one of the pages. My problem is that the page has some ajax links on it (click on the link results to html changes). How would I be able to make the clicks of the link and get the html of the final state using php? Seems like from researching this I need some sort of headless browser? Is there something like that in php I can use?

Was it helpful?

Solution

I'm not aware of any headless browsers that supports Javascript/AJAX that you can drive with PHP. If you want to drive a real browser with PHP, see http://seleniumhq.org/

OTHER TIPS

Had this exact problem a few minutes ago. This works like a charm. Use .live() as the top answer here explains.

Reload javascript file after an AJAX request

Tested and works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top