sk31415 commited on
Commit
da7102f
·
1 Parent(s): 3e2fda5

updated file submission logic

Browse files
Files changed (1) hide show
  1. HandshakeJobApply.py +12 -1
HandshakeJobApply.py CHANGED
@@ -902,7 +902,18 @@ Return ONLY the coordinates string in quotes, nothing else. No JSON, no markdown
902
  "//button[contains(text(), 'Submit Application')]")
903
  self.driver.execute_script("arguments[0].scrollIntoView();", submit_button)
904
  submit_button.click()
905
- time.sleep(3) # Wait for submission
 
 
 
 
 
 
 
 
 
 
 
906
 
907
  print(f'✅ Application submitted successfully!')
908
  if progress_callback:
 
902
  "//button[contains(text(), 'Submit Application')]")
903
  self.driver.execute_script("arguments[0].scrollIntoView();", submit_button)
904
  submit_button.click()
905
+ time.sleep(5) # Wait for submission
906
+
907
+ try:
908
+ xButton=self.driver.find_element(By.CSS_SELECTOR,"button[aria-label='Cancel application']")
909
+ if xButton:
910
+ xButton.click()
911
+ time.sleep(2)
912
+ print(f'Application unsuccessful')
913
+ if progress_callback:
914
+ progress_callback("Application submission failed", "error")
915
+ except NoSuchElementException:
916
+ pass
917
 
918
  print(f'✅ Application submitted successfully!')
919
  if progress_callback: