diff --git a/hasaki_crawler_engine/test_selenium.py b/hasaki_crawler_engine/test_selenium.py index 8d171f3..a655488 100644 --- a/hasaki_crawler_engine/test_selenium.py +++ b/hasaki_crawler_engine/test_selenium.py @@ -2,6 +2,7 @@ import logging from fake_useragent import UserAgent import brotli import seleniumwire.undetected_chromedriver as uc +from selenium_stealth import stealth import json import time @@ -12,6 +13,7 @@ def get_raw_product_data_selenium(url): op = uc.ChromeOptions() op.add_argument(f"user-agent={random_mobile_ua}") + op.add_argument('--blink-settings=imagesEnabled=false') #op.add_experimental_option("useAutomationExtension", False) #op.add_argument('--no-sandbox') #op.add_argument('--disable-notifications') @@ -19,6 +21,13 @@ def get_raw_product_data_selenium(url): op.headless = False driver = uc.Chrome(version_main=122, options=op) + stealth(driver, + languages=["en-US", "en"], + vendor="Google Inc.", + webgl_vendor="Intel Inc.", + renderer="Intel Iris OpenGL Engine", + fix_hairline=True, + ) driver.get(url)