Answer the question
In order to leave comments, you need to log in
Can ChromeOption be set to save the file?
$options = (new ChromeOptions)
->addArguments(['
'--headless',
'--no-sandbox',
'--disable-gpu',
'--disable-popup-blocking',
'--window-size=1366,768'
])->setExperimentalOption('prefs', [
'download.directory_upgrade' => true,
'download.prompt_for_download' => false,
'download.default_directory' => public_path().'/ugj',
'browser.set_download_behavior' => [ 'behavior' => 'allow'],
'safebrowsing.enabled'=>true,
]);
$this->browser = new Browser(
RemoteWebDriver::create(
'http://localhost:4444/wd/hub',
DesiredCapabilities::chrome()
->setCapability(ChromeOptions::CAPABILITY, $options)
->setCapability(WebDriverCapabilityType::BROWSER_NAME, 'chrome')
)
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question