views:

97

answers:

1

HI,

I want to extract data from a website but it uses some strange javascript so I can't get the job done with cURL. I want to know is there anything like virtual browser which opens up the page and I can initiate click on some buttons?

If not is there any executable program to achieve this task via command line?

+3  A: 

You have a few options:

http://stackoverflow.com/questions/199045/is-there-a-php-equivalent-of-perls-wwwmechanize

This one looks like it would fit the bill: ScriptableBrowser - http://www.lastcraft.com/browser_documentation.php

EDIT- I see that you need a virtual browser with Javascript support.. I found a few options for Ruby and Python, but nothing in PHP. Maybe you will have to drive this part of the application from a different language, or write it yourself. Or look into something like Selenium, there might be a way to use it for what you need.

More info:

http://stackoverflow.com/questions/802225/mechanize-and-javascript

http://pypi.python.org/pypi/DOMForm/0.0.1a/

Infinity