Skip to content
Advertisement

PHP Selenium Blocked by CORS Policy

I am trying to access a website with selenium and i am getting below error

enter image description here

And i used the following code i have tried header('Access-Control-Allow-Origin: *'); but did’t work for me

JavaScript

Advertisement

Answer

It could be you’re using old php webdriver client (2013) ? which is not compatible with current selenium and browser.

use updated PHP selenium facebook/webdriver and here the setup step:

JavaScript

read the github page above if it missing something.

and PHP code

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement