Omnibus commited on
Commit
636eb39
·
verified ·
1 Parent(s): 8830ea3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -84,15 +84,15 @@ def run_script(url: str, height: int, width: int):
84
  screenshot = obj.screenshot(f'{uid}-tmp.png')
85
  #screenshot = obj.get_screenshot_as_png()
86
  except WebDriverException as e:
87
- return [Image.new('RGB', (1, 1)), f'<center>{e}',mes_box]
88
  finally:
89
  if driver:
90
  driver.quit()
91
 
92
  #return [Image.open(BytesIO(screenshot)), 'operation success.',cookie_jar,html]
93
- return [Image.open(f'{uid}-tmp.png'), '<center>operation success.',mes_box]
94
  else:
95
- return [None, '<center>Please enter a valid URL of a website/host.',mes_box]
96
 
97
  with gr.Blocks() as app:
98
 
 
84
  screenshot = obj.screenshot(f'{uid}-tmp.png')
85
  #screenshot = obj.get_screenshot_as_png()
86
  except WebDriverException as e:
87
+ return Image.new('RGB', (1, 1)), f'<center>{e}',mes_box
88
  finally:
89
  if driver:
90
  driver.quit()
91
 
92
  #return [Image.open(BytesIO(screenshot)), 'operation success.',cookie_jar,html]
93
+ return Image.open(f'{uid}-tmp.png'), '<center>operation success.',mes_box
94
  else:
95
+ return None, '<center>Please enter a valid URL of a website/host.',mes_box
96
 
97
  with gr.Blocks() as app:
98