4

I have a small Python app that simply records a webpage / web animation with Selenium and FFmpeg. Worked like a charm until yesterday.

It seems that Google has removed the "--disable-infobars" feature. Can this be disabled from another flag or function?

Or am I forced to add padding to the top and record from the padding?

Here's an example code

#!/usr/bin/env python3 from pyvirtualdisplay import Display import os from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver.chrome.options import Options url = "http://foo.bar" os.environ['DISPLAY'] = ':99' display = Display(visible=0, size=(1920, 1080)) display.start() display_port = os.environ['DISPLAY'] chrome_driver_path = "/usr/local/bin/chromedriver" options = webdriver.ChromeOptions() options.add_argument('--disable-gpu') options.add_argument('--kiosk') options.add_argument('--window-position=0,0') options.add_argument('--disable-infobars'); options.add_argument('--window-size=1920,1080') browser = webdriver.Chrome(executable_path=chrome_driver_path, chrome_options=options) browser.get(url) command = "/home/fidox/bin/ffmpeg -r 60 -t {} -video_size {}x{} -framerate 60 -f x11grab -i foo.mp4 f-an {}".format(10,1920,1080,display_port) os.system(command) self.browser.quit() display.stop() 
1
  • Post chrome browser version, and chrome driver version...as --disable-infobars working for me Commented Mar 8, 2018 at 16:22

3 Answers 3

9

For Python3.

chrome_options = webdriver.ChromeOptions() chrome_options.add_experimental_option("useAutomationExtension", False) chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"]) driver = webdriver.Chrome(options=chrome_options) 
Sign up to request clarification or add additional context in comments.

Comments

0

Did you update to Chrome 65? If you go to view about Chrome it'll auto update. Chromedriver appears broken in Chrome 65. You can uninstall and reinstall Chrome 64.

3 Comments

Chrome seems to have auto updated. Can I turn off auto update function? Feels sad to stay on 64, but if thats the only solution then I’ll have to face that
You can try updating your chromedriver: sites.google.com/a/chromium.org/chromedriver/downloads also Giving that a go myself right now.
0

disable-infobars flag has been removed but you can get rid of the message by adding the following:

ChromeOptions options = new ChromeOptions(); options.setExperimentalOption("useAutomationExtension", false); options.setExperimentalOption("excludeSwitches",Collections.singletonList("enable-automation")); WebDriver driver = new ChromeDriver(options); 

This work for me and I hope works for you too.

Don't know how to do this in python. kindly convert above code accordingly.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.