From 1f2f93184e61095495a6f3f39b611c1269a45968 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Fri, 6 May 2022 23:59:38 +0200 Subject: [PATCH] Playwright fetcher - use the correct default User-Agent --- changedetectionio/content_fetcher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changedetectionio/content_fetcher.py b/changedetectionio/content_fetcher.py index 7c6457b3..e8dc057e 100644 --- a/changedetectionio/content_fetcher.py +++ b/changedetectionio/content_fetcher.py @@ -130,8 +130,9 @@ class base_html_playwright(Fetcher): browser = browser_type.connect_over_cdp(self.command_executor, timeout=timeout * 1000) # Set user agent to prevent Cloudflare from blocking the browser + # Use the default one configured in the App.py model that's passed from fetch_site_status.py context = browser.new_context( - user_agent="Mozilla/5.0", + user_agent=request_headers['User-Agent'] if request_headers.get('User-Agent') else 'Mozilla/5.0', proxy=self.proxy ) page = context.new_page()