Answer the question
In order to leave comments, you need to log in
How to make friends Laravel Dusc and proxy?
Good day! Faced with the task of parsing a site, or rather a large number of sites. All sites are +\- of the same type. Decided to do it on Laravel. But you can’t just go to some sites (redirect), I read that Dusc is like puppeeter.js. But no matter how much I searched and wriggled with queries on google, I can’t find anything on how to use a proxy with this wonderful package. Maybe one of you is more familiar with Dusc, or at least can direct me where to look?
Answer the question
In order to leave comments, you need to log in
Using setCapability, you can set parameters for launching the browser.
You need to set an argument
--proxy-server= localhost:8080in the chrome.switches section.
$options = (new ChromeOptions)->addArguments(collect([
'--window-size=1920,1080',
])->unless($this->hasHeadlessDisabled(), function ($items) {
return $items->merge([
'--disable-gpu',
'--headless',
]);
})->all());
return RemoteWebDriver::create(
$_ENV['DUSK_DRIVER_URL'] ?? 'http://localhost:9515',
DesiredCapabilities::chrome()->setCapability(
ChromeOptions::CAPABILITY, $options
)
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question