-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does nobybody needs this to open the browser with the current profile? #119
Comments
def start_chrome(url=None, headless=False, maximize=False, options=None):
"""
:param url: URL to open.
:type url: str
:param headless: Whether to start Chrome in headless mode.
:type headless: bool
:param maximize: Whether to maximize the Chrome window.
Ignored when `headless` is set to `True`.
:type maximize: bool
:param options: ChromeOptions to use for starting the browser
:type options: :py:class:`selenium.webdriver.ChromeOptions` I believe |
import os
from helium import *
from selenium.webdriver import Chrome, ChromeOptions
from selenium.webdriver.chrome.service import Service as ChromeService
def launch_webdriver():
ROOTPATH = os.path.join(os.path.expanduser("~"), "Desktop", "2024")
DOWNLOAD_FOLDER = os.path.join(ROOTPATH,'download')
USERDATA_FOLDER = os.path.join(ROOTPATH,'selenium')
prefs = {
'download.directory_upgrade': True,
'download.prompt_for_download': 'false',
'profile.default_content_settings.multiple-automatic-downloads': 1,
'download.default_directory': DOWNLOAD_FOLDER
}
options = ChromeOptions()
options.add_argument('--user-data-dir={}'.format(USERDATA_FOLDER))
options.add_argument('--window-size=960,1200')
options.add_argument('--disable-remote-fonts')
options.add_argument('--hide-scrollbars')
chromedriver_path = 'chromedriver.exe'
service = ChromeService(executable_path=chromedriver_path)
driver = Chrome(options=options, service=service)
set_driver(driver)
go_to('https://www.google.com/') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
is there a way to start chrome with my current Default profile?
it's useless for the most of my tasks when it opens the browser with a new and empty profile
The text was updated successfully, but these errors were encountered: