MA
Size: a a a
MA
R(
R(
AM
М
AM
О
EE
S
AI
G
G
СБ
require 'selenium-webdriver'
chrome_path = <<~PATH
/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary
PATH
Selenium::WebDriver::Chrome.path = chrome_path.chomp
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument '--headless'
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
options.add_argument('--disable-popup-blocking')
options.add_preference(
:download,
directory_upgrade: true,
prompt_for_download: false,
default_directory: __dir__
)
options.add_preference(:browser, set_download_behavior: { behavior: 'allow' })
driver = Selenium::WebDriver.for :chrome, options: options
driver.manage.timeouts.implicit_wait = 10
driver.manage.window.resize_to 1920, 1080
bridge = driver.send :bridge
path = "/session/#{bridge.session_id}/chromium/send_command"
bridge.http.call(
:post, path,
cmd: 'Page.setDownloadBehavior',
params: {
behavior: 'allow',
downloadPath: __dir__
}
)
СБ
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("download.default_directory=C:/Downloads")
driver = webdriver.Chrome(chrome_options=options)
AI
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("download.default_directory=C:/Downloads")
driver = webdriver.Chrome(chrome_options=options)
A
IS
Y
СБ
Y