Mac
1: Use phpLanguage writing control script
2: The script communicates with the chrome driver (chromedriver) program
3: chromedriver controls chrome execution operations
Process: php script => chromedriver => chrome
Wall circumvention tool
chrome browser
chromedriver
chromedriver
php-webdriver
Class library for php to communicate with chromedriver
Installationphp-webdriver Create a demo directory and execute
composer require facebook/webdriver
get('http://www.baidu.com'); $cookies = $driver->manage()->getCookies(); print_r($cookies); echo "The title is '" . $driver->getTitle() . "'\n"; echo "The current URI is '" . $driver->getCurrentURL() . "'\n"; //关闭浏览器 $driver->quit();
php demo.php
The above is the detailed content of PHP controls browser actions. For more information, please follow other related articles on the PHP Chinese website!