mgokg commited on
Commit
141bc3a
·
verified ·
1 Parent(s): 60bc03e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -15,12 +15,12 @@ def take_screenshot(url):
15
  wd = webdriver.Chrome(options=options)
16
  wd.set_window_size(1080, 720) # Adjust the window size here
17
  wd.get(url)
18
- wd.implicitly_wait(10)
19
  resp=driver.find_element(By.TAG_NAME, "a")
20
  return resp
21
  #screenshot = wd.get_screenshot_as_png()
22
  except WebDriverException as e:
23
- return Image.new('RGB', (1, 1))
24
  finally:
25
  if wd:
26
  wd.quit()
 
15
  wd = webdriver.Chrome(options=options)
16
  wd.set_window_size(1080, 720) # Adjust the window size here
17
  wd.get(url)
18
+ wd.implicitly_wait(5)
19
  resp=driver.find_element(By.TAG_NAME, "a")
20
  return resp
21
  #screenshot = wd.get_screenshot_as_png()
22
  except WebDriverException as e:
23
+ return resp
24
  finally:
25
  if wd:
26
  wd.quit()