honey234 commited on
Commit
6999795
·
1 Parent(s): 9c4ee58
Files changed (2) hide show
  1. __pycache__/app.cpython-311.pyc +0 -0
  2. app.py +7 -0
__pycache__/app.cpython-311.pyc CHANGED
Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ
 
app.py CHANGED
@@ -61,11 +61,18 @@ header = Headers().generate()["User-Agent"]
61
  capabilities = webdriver.DesiredCapabilities.FIREFOX
62
  # proxy = None
63
  browser_option = Options()
 
64
  browser_option.add_argument("--headless") # Running in headless mode (no GUI)
65
  browser_option.add_argument("--no-sandbox")
66
  browser_option.add_argument("--disable-dev-shm-usage")
67
  browser_option.add_argument("--ignore-certificate-errors")
 
 
 
 
 
68
  browser_option.binary_location = '/usr/bin/firefox'
 
69
  # browser_option.add_argument("--disable-gpu")
70
  # browser_option.add_argument("--log-level=3")
71
  # browser_option.add_argument("--disable-notifications")
 
61
  capabilities = webdriver.DesiredCapabilities.FIREFOX
62
  # proxy = None
63
  browser_option = Options()
64
+ browser_option.log.level = 'trace'
65
  browser_option.add_argument("--headless") # Running in headless mode (no GUI)
66
  browser_option.add_argument("--no-sandbox")
67
  browser_option.add_argument("--disable-dev-shm-usage")
68
  browser_option.add_argument("--ignore-certificate-errors")
69
+ profile = webdriver.FirefoxProfile()
70
+ profile.set_preference("general.useragent.override", "Your User Agent String")
71
+ browser_option.profile = profile
72
+ logging.info(f"browser_version: {browser_option.browser_version}")
73
+ browser_option.capabilities = capabilities
74
  browser_option.binary_location = '/usr/bin/firefox'
75
+ # browser_option.binary_location = r'C:\Users\HP\.cache\selenium\firefox\win64\133.0\firefox.exe'
76
  # browser_option.add_argument("--disable-gpu")
77
  # browser_option.add_argument("--log-level=3")
78
  # browser_option.add_argument("--disable-notifications")