mr javad
mr javad

Reputation: 183

using selenium without browser screen - python windows

i use selenium for instagram appicatin. i wonder there is any way to run selenium without browser opening in windows? there is some solution in linux like install Xvfb but i don't see any solution for windows!

Upvotes: 0

Views: 569

Answers (1)

jizhihaoSAMA
jizhihaoSAMA

Reputation: 12672

Do you mean that --headless?

You can do some operations without opening Chrome if you have chrome-driver. Here is how to set headless:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chromeoption = Options()
chromeoption.add_argument('--headless')
browser = webdriver.Chrome(options=chromeoption)

# Then it is your work.
browser.get(url="xxx")

Upvotes: 3

Related Questions