0

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!

asked Mar 15, 2020 at 13:15

1 Answer 1

3

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")
answered Mar 15, 2020 at 13:19

2 Comments

In order to use this code, it is obligatory to download the driver? Or does exist the way to use selenium without a driver? (I know collab version)
@shorenatevzadze No, you must download the driver AFAIK. The driver provide the API to make sure user could operate the browser.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.