I keep getting console errors about Permissions-Policy headers when I run my Selenium script with Chrome in headless mode. I’m using chromedriver version 89 with Chrome browser version 89.0. The error message says “Unrecognized feature: ‘interest-cohort’” and it appears multiple times in the console output.
Here’s my current setup:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from shutil import which
chrome_opts = Options()
chrome_opts.add_argument("--headless")
driver_path = which("chromedriver")
browser = webdriver.Chrome(executable_path=driver_path, options=chrome_opts)
browser.get("https://www.google.com/")
search_box = browser.find_element_by_name("q")
search_box.send_keys("test query")
search_box.send_keys(Keys.RETURN)
The console keeps showing these permission policy errors. Is there a way to suppress these messages or fix the underlying issue? The script works fine but these error messages are cluttering my output.
This happens because Chrome headless still processes all web standards including newer privacy policies, but your chromedriver version might not fully support them. Instead of disabling security features, I’d update both Chrome and chromedriver to the latest versions first - this fixes compatibility issues in most cases. If you’re stuck with version 89, add --log-level=3 to your chrome options to suppress console output. This filters out INFO, WARNING, and ERROR messages. You can also capture and filter logs programmatically using Selenium’s logging capabilities rather than messing with browser security settings. The interest-cohort warnings won’t hurt anything for automation and won’t break your script.
those perm policy errors can be real pain! try adding --disable-web-security and --disable-features=VizDisplayCompositor in your chrome options. upgrading chromeDriver might help too, newer versions are better with this stuff.
I’ve hit this same issue with headless Chrome automation. The interest-cohort error comes from Google’s Privacy Sandbox stuff - it triggers when the browser tries to handle certain ad features. Try adding --disable-blink-features=AutomationControlled and --no-sandbox to your Chrome options. That usually kills these permission policy warnings. You can also throw in --disable-logging if you want to shut up all the console noise, assuming the errors aren’t breaking your script. Honestly, these warnings are just visual clutter when you’re doing headless scraping or testing - they won’t mess with your actual operations.