Home>

【environment】
MACBookPro, Python3, Jupyter Notebook

[What I want to do]
Open another tab in Selenium (not open a new window)
If i use it as it is in the browser, it will be overwritten, Excel can not be downloaded well,
I tried to set up another browser, but it takes time to erase chrome when the number increases, so
If there is a way to create a new tab with the same browser, I would appreciate it if you could teach me.
I used pyautogui.hotkey ('command','t'), but it runs in the Jyupeter notebook browser instead of the Selenium open browser
【image】

[Code]

from selenium import webdriver
import time
import pandas as pd
import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

#LOGIN
USER ='XXX'
PASS ='YYY'
#Launch browser
browser = webdriver.Chrome () # Mac
browser.implicitly_wait (3)
url_login ='https: // xxx'
browser.get (url_login)
time.sleep (3)
print ("accessed login page")
#Text box input
element = browser.find_element_by_xpath ('')
element.send_keys (USER)
element1 = browser.find_element_by_xpath ('')
element1.send_keys (PASS)
#Create another tab on the same browser
pyautogui.hotkey ('command','t')