i need a script that logins to amazon on schedule. I am trying to automate it with selenium. But each time i am trying to login amazon sends a sms with password which is hard to retrive. I need to be able to this without this extra step. i decided to use separate chrome profile. but now when i run my script it freeze and i see Two-Step Verification
in my console without any other error on top of this i do not see window of chrome with a blank tab. just a freeze and then this message.
Here is my code.
require_once('vendor/autoload.php');
use Applitools\RectangleSize;
use Applitools\Selenium\Eyes;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\WebDriverCapabilityType;
use Facebook\WebDriver\WebDriverBy;
$host = 'http://localhost:4444/wd/hub'; // this is the default
$capabilities = \Facebook\WebDriver\Remote\DesiredCapabilities::chrome();
$options = new \Facebook\WebDriver\Chrome\ChromeOptions();
$options->addArguments(array(
'--headless',
'--no-sandbox',
"--disable-extensions",
'--window-size=1920,1080',
'user-data-dir=C:\Users\1\AppData\Local\Google\Chrome\User Data\Profile 3',
));
$options->addArguments(["start-maximized"]);
$options->setExperimentalOption("useAutomationExtension", false);
//$options->setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
$capabilities->setCapability(\Facebook\WebDriver\Chrome\ChromeOptions::CAPABILITY, $options);
$driver = RemoteWebDriver::create($host, $capabilities,1000);
//$driver->manage()->window()->maximize();
sleep(3);
$driver->get("https://sellercentral.amazon.com/");
If i remove this line
'user-data-dir=C:\Users\1\AppData\Local\Google\Chrome\User Data\Profile 3',
everything works fine except each session is unique and i have to retrive a pass they send.