![]() ![]() Note : -disable-gpu argument is implemented internally. Sample Code : from selenium import webdriver ![]() Headless: boolean value indicating to set the headless option Invoking google-chrome in headless mode programmatically have become much easier with the availability of the method set_headless(headless=True) as follows :ĭocumentation : set_headless(headless=True) To initiate a google-chrome-headless browsing context using Selenium driven ChromeDriver now you can just set the -headless property to true through an instance of Options() class as follows:Įffective code block: from selenium import webdriverĭriver = webdriver.Chrome(options=options, executable_path=r'C:\path\to\chromedriver.exe') Update : These days you can just do this: from selenium import webdriver This works for me using Python 3.6, I'm sure it'll work for 2.7 too. Options.add_argument('-disable-gpu') # Last I checked this was necessary.ĭriver = webdriver.Chrome(CHROMEDRIVER_PATH, chrome_options=options) ![]() It should look like this: from selenium import webdriverįrom import Options ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |