When crawling, how to set selenium, not to pop up the browser when starting

it"s acceptable for browsers to pop up once like this, but it"s annoying to have to do multiple page jumps. How can I crawl without popping the window? I read on the Internet that it is said to use the driver = webdriver.PhantomJS () method, but I can still pop the window when I use this method. Later, I saw that I used HtmlUnitDriver, without interface, but I didn"t have it on my computer. As soon as I compiled it, I made an error. I searched the Internet and couldn"t find the relevant download resources. Excuse me, how did you solve the problem?

Mar.04,2021

chrome launched headless mode, upgrade to the latest chrome, and try my configuration

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
driver = webdriver.chrome(chrome_options=chrome_options)

Menu