rishi1985 commited on
Commit
226829c
1 Parent(s): 3fca565

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -167,8 +167,9 @@ def do_ML_LLAMA70b(text:str, trycount:int):
167
  except:
168
  print("Element is not present.")
169
 
170
- element = driver.find_element(By.XPATH,'//div[@data-testid="bot" and contains(@class, "message bot")]')
171
- element_text= element.text
 
172
  if element_text=="":
173
  pritn("empty text exception")
174
  continue
@@ -183,7 +184,8 @@ def do_ML_LLAMA70b(text:str, trycount:int):
183
  return " --Error Occurred-- "
184
 
185
 
186
- except:
 
187
  driver.delete_all_cookies()
188
  driver.quit()
189
  llama_last_error= time.time()
 
167
  except:
168
  print("Element is not present.")
169
 
170
+ parent_element = driver.find_elements(By.CLASS_NAME,'message')
171
+ extracted_text = parent_element[1].text
172
+ element_text= extracted_text
173
  if element_text=="":
174
  pritn("empty text exception")
175
  continue
 
184
  return " --Error Occurred-- "
185
 
186
 
187
+ except Exception as e:
188
+ print(e)
189
  driver.delete_all_cookies()
190
  driver.quit()
191
  llama_last_error= time.time()