Container commited on
Commit
b6c7a06
·
verified ·
1 Parent(s): 19f5db9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -94,8 +94,10 @@ def chrome(url:str=None,wait:int=5,header:str=None,cookie:str=None,cookie_domain
94
  for key, value in cookie_array.items():
95
  try:
96
  if cookie_domain :
97
- target_domain = cookie_domain
98
- driver.add_cookie({"name": key, "value": quote(value), "domain": f'.{target_domain}', "path": "/"})
 
 
99
  except Exception as e:
100
  print("Error Cookie:")
101
  print({"name": key, "value": quote(value), "domain": f'.{target_domain}', "path": "/"})
 
94
  for key, value in cookie_array.items():
95
  try:
96
  if cookie_domain :
97
+ domain = cookie_domain
98
+ else:
99
+ domain = f'.{target_domain}'
100
+ driver.add_cookie({"name": key, "value": quote(value), "domain": domain, "path": "/"})
101
  except Exception as e:
102
  print("Error Cookie:")
103
  print({"name": key, "value": quote(value), "domain": f'.{target_domain}', "path": "/"})