Omnibus commited on
Commit
5758a89
1 Parent(s): 3c1d120

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -121,7 +121,24 @@ def run_script(url: str, height: int, width: int, check_b,check_h,wait_time):
121
  print(html)
122
  driver.implicitly_wait(int(wait_time*30))
123
  driver.set_window_size(int(width), int(height))
124
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  screenshot = driver.save_screenshot(f'{uid}-tmp.png')
126
  except WebDriverException as e:
127
  return Image.new('RGB', (1, 1)), f'<center>Please enter a valid URL of a website/host.',out_box,out
 
121
  print(html)
122
  driver.implicitly_wait(int(wait_time*30))
123
  driver.set_window_size(int(width), int(height))
124
+
125
+ main_head = driver.find_element(By.CLASS_NAME, "main-content-header")
126
+ head_shot = main_head.screenshot(f'head-{uid}-tmp.png')
127
+ obj = driver.find_element(By.CLASS_NAME, "main")
128
+ messages = driver.find_elements(By.CLASS_NAME, "user-row")
129
+ for i,ea in enumerate(check_b):
130
+ try:
131
+ ea = int(ea)
132
+ ea = (ea*2)-2
133
+ print (ea)
134
+ messages[ea].screenshot(f'{i}-{uid}-tmp.png')
135
+ messages[ea+1].screenshot(f'{i+1}-{uid}-tmp.png')
136
+ im_roll = get_concat_v_cut(f'{i}-{uid}-tmp.png',f'{i+1}-{uid}-tmp.png')
137
+ im_roll.save(f'comb{i}-{uid}-tmp.png')
138
+ out_box.append(f'comb{i}-{uid}-tmp.png')
139
+ except Exception:
140
+ mes="<center>Some blocks returned an error"
141
+
142
  screenshot = driver.save_screenshot(f'{uid}-tmp.png')
143
  except WebDriverException as e:
144
  return Image.new('RGB', (1, 1)), f'<center>Please enter a valid URL of a website/host.',out_box,out