'Open a chrome profile with full functionality in Selenium

I have a code in cmd that opens an arbitrary Chrome profile and it works very well.

start "" G:\Multi_Chrome_Part_1\ChromeFirstProVip\GoogleChromePortable.exe" --profile-directory="Profile 17". Tt shows up as usual:

Open normally with pre-made gmail

But I'm having a lot of trouble opening with Selenium. I use the code below:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("user-data-dir=G:\\Multi_Chrome_Part_1\\ChromeFirstProVip\\Data\\profile\\Profile 17")
driver = webdriver.Chrome(service=Service("D:\\Python\\FirstProject\\chromedriver_99_0_4844_51.exe"), options=options)
driver.get("https://www.google.co.in")

With selenium, it cannot open a complete profile, missing gmail. It looks like this:

Missing_a_lot

As you can see, in addition to not accepting pre-imported gmail, it also lacks the extensions that I have installed before, as well as other components. Some websites are also not accessible with Selenium

I want to ask is there a way to turn the code above into the bottom? Is there a way to make Selenium like a normal Chrome profile? I don't understand why opening with cmd is perfect, but selenium has problems. Thank you very much if you can help



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source