mexc API failed, working on futures API as it what i we need anyway
This commit is contained in:
@ -27,7 +27,6 @@ try:
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
from selenium.common.exceptions import TimeoutException, WebDriverException
|
||||
from webdriver_manager.chrome import ChromeDriverManager
|
||||
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
|
||||
except ImportError:
|
||||
print("Please install selenium and webdriver-manager:")
|
||||
print("pip install selenium webdriver-manager")
|
||||
@ -68,16 +67,21 @@ class MEXCRequestInterceptor:
|
||||
self.cookies_file = f"mexc_cookies_{self.timestamp}.json"
|
||||
|
||||
def setup_chrome_with_logging(self) -> webdriver.Chrome:
|
||||
"""Setup Chrome with performance logging enabled"""
|
||||
logger.info("Setting up ChromeDriver with request interception...")
|
||||
"""Setup Brave browser with performance logging enabled"""
|
||||
logger.info("Setting up ChromeDriver with request interception for Brave browser...")
|
||||
|
||||
# Chrome options
|
||||
# Chrome options (used for Brave as it's Chromium-based)
|
||||
chrome_options = Options()
|
||||
|
||||
if self.headless:
|
||||
chrome_options.add_argument("--headless")
|
||||
logger.info("Running in headless mode")
|
||||
|
||||
# Set the binary location for Brave
|
||||
# brave_binary_path = "C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"
|
||||
# chrome_options.binary_location = brave_binary_path
|
||||
# logger.info(f"Using Brave binary at: {brave_binary_path}")
|
||||
|
||||
# Essential options for automation
|
||||
chrome_options.add_argument("--no-sandbox")
|
||||
chrome_options.add_argument("--disable-dev-shm-usage")
|
||||
@ -99,12 +103,14 @@ class MEXCRequestInterceptor:
|
||||
chrome_options.add_argument("--log-level=0")
|
||||
chrome_options.add_argument("--v=1")
|
||||
|
||||
# Set capabilities for performance logging
|
||||
caps = DesiredCapabilities.CHROME
|
||||
caps['goog:loggingPrefs'] = {
|
||||
# Set logging preferences for performance data
|
||||
chrome_options.set_capability('goog:loggingPrefs', {
|
||||
'performance': 'ALL',
|
||||
'browser': 'ALL'
|
||||
}
|
||||
})
|
||||
|
||||
# # Add profile directory argument as provided by the user
|
||||
# chrome_options.add_argument("--profile-directory=Profile 3")
|
||||
|
||||
try:
|
||||
# Automatically download and install ChromeDriver
|
||||
@ -114,8 +120,7 @@ class MEXCRequestInterceptor:
|
||||
# Create driver
|
||||
driver = webdriver.Chrome(
|
||||
service=service,
|
||||
options=chrome_options,
|
||||
desired_capabilities=caps
|
||||
options=chrome_options
|
||||
)
|
||||
|
||||
# Hide automation indicators
|
||||
|
Reference in New Issue
Block a user