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 seeTwo-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.
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.