From f46771b28776e1eb8e96b2342fd71d549c33bd25 Mon Sep 17 00:00:00 2001 From: "shariar@raenabeauty.com" Date: Wed, 3 Apr 2024 13:42:04 +0400 Subject: [PATCH] added Hasaki crawler --- hasaki_crawler_engine/test_selenium.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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)