Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any 'virtual browser' in PHP?

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?

like image 360
Shubham Avatar asked Nov 28 '25 19:11

Shubham


1 Answers

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/

like image 133
adamJLev Avatar answered Nov 30 '25 10:11

adamJLev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!