Tutorial :Is there any 'virtual browser' in PHP?



Question:

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?


Solution:1

You have a few options:

Is there a PHP equivalent of Perl's WWW::Mechanize?

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:

How do I use Mechanize to process JavaScript?

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »