honey234 commited on
Commit
9c4ee58
·
1 Parent(s): 370b561
Files changed (2) hide show
  1. __pycache__/app.cpython-311.pyc +0 -0
  2. app.py +4 -3
__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
@@ -54,8 +54,8 @@ def setup_chromedriver():
54
 
55
  # Setup headless Chrome options
56
  # Define a custom user agent
57
- my_user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0"
58
-
59
  # my_user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36"
60
 
61
  capabilities = webdriver.DesiredCapabilities.FIREFOX
@@ -70,7 +70,8 @@ browser_option.binary_location = '/usr/bin/firefox'
70
  # browser_option.add_argument("--log-level=3")
71
  # browser_option.add_argument("--disable-notifications")
72
  # browser_option.add_argument("--disable-popup-blocking")
73
- browser_option.add_argument(f"--user-agent={my_user_agent}")
 
74
 
75
  # if proxy:
76
  # browser_option.add_argument(f"--proxy-server={proxy}")
 
54
 
55
  # Setup headless Chrome options
56
  # Define a custom user agent
57
+ # my_user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0"
58
+ header = Headers().generate()["User-Agent"]
59
  # my_user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36"
60
 
61
  capabilities = webdriver.DesiredCapabilities.FIREFOX
 
70
  # browser_option.add_argument("--log-level=3")
71
  # browser_option.add_argument("--disable-notifications")
72
  # browser_option.add_argument("--disable-popup-blocking")
73
+ # browser_option.add_argument(f"--user-agent={my_user_agent}")
74
+ browser_option.add_argument("--user-agent={}".format(header))
75
 
76
  # if proxy:
77
  # browser_option.add_argument(f"--proxy-server={proxy}")