UPDATE
I could not get the stored login for Facebook to pass to a profile in selenium. So I put together some login code for you.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
chrome_options = Options()
chrome_options.add_argument("start-maximized")
chrome_options.add_argument("--disable-infobars")
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument("--disable-popup-blocking")
# disable the banner "Chrome is being controlled by automated test software"
chrome_options.add_experimental_option("useAutomationExtension", False)
chrome_options.add_experimental_option("excludeSwitches", ['enable-automation'])
# global driver
driver = webdriver.Chrome('/usr/local/bin/chromedriver', options=chrome_options)
driver.get('https://www.facebook.com')
driver.implicitly_wait(10)
username_box = driver.find_element_by_xpath('//*[@id ="email"]')
username_box.send_keys('username')
password_box = driver.find_element_by_xpath('//*[@id ="pass"]')
password_box.send_keys('password')
WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.NAME, "login"))).click()
ORIGINAL POST
Here is some code that only opens 1 tab and pass your profile.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("start-maximized")
chrome_options.add_argument("--disable-infobars")
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument("--disable-popup-blocking")
# you need to verify this path on your Windows systems.
chrome_options.add_argument("user-data-dir=/Users/username/Library/Application Support/Google Chrome/User Data")
chrome_options.add_argument("profile-directory=Profile 1")
# disable the banner "Chrome is being controlled by automated test software"
chrome_options.add_experimental_option("useAutomationExtension", False)
chrome_options.add_experimental_option("excludeSwitches", ['enable-automation'])
driver = webdriver.Chrome('/usr/local/bin/chromedriver', options=chrome_options)
driver.get('https://www.facebook.com')
Have you tried to write any code around logging into Facebook after Chrome opens? if not, looks at some of these past questions: https://stackoverflow.com/search?q=login+into+facebook+with+selenium+python