Omnibus commited on
Commit
214efd8
1 Parent(s): 1b38c3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -35,7 +35,7 @@ def get_concat_v_cut(in1, in2):
35
 
36
 
37
 
38
- def run_script(url: str, height: int, width: int, check_b,check_h):
39
  mes_box=[]
40
  out_box=[]
41
  uid=uuid.uuid4()
@@ -113,14 +113,14 @@ def run_script(url: str, height: int, width: int, check_b,check_h):
113
  mes='<center>operation success'
114
  try:
115
  driver = webdriver.Chrome(options=options)
116
- driver.current_window_handle
117
- #driver.get(url)
118
  html=driver.page_source
119
  print(html)
120
  driver.implicitly_wait(30)
121
  driver.set_window_size(int(width), int(height))
122
 
123
- screenshot = driver.screenshot(f'{uid}-tmp.png')
124
  except WebDriverException as e:
125
  return Image.new('RGB', (1, 1)), f'<center>Please enter a valid URL of a website/host.',out_box,out
126
  finally:
 
35
 
36
 
37
 
38
+ def run_script1(url: str, height: int, width: int, check_b,check_h):
39
  mes_box=[]
40
  out_box=[]
41
  uid=uuid.uuid4()
 
113
  mes='<center>operation success'
114
  try:
115
  driver = webdriver.Chrome(options=options)
116
+ #driver.current_window_handle
117
+ driver.get(driver.current_window_handle)
118
  html=driver.page_source
119
  print(html)
120
  driver.implicitly_wait(30)
121
  driver.set_window_size(int(width), int(height))
122
 
123
+ screenshot = driver.save_screenshot(f'{uid}-tmp.png')
124
  except WebDriverException as e:
125
  return Image.new('RGB', (1, 1)), f'<center>Please enter a valid URL of a website/host.',out_box,out
126
  finally: