Browse Source

update way that buttons are found

Signed-off-by: Michael Tang <michaelhtang@gmail.com>
Michael Tang 4 years ago
parent
commit
adce92259c
1 changed files with 5 additions and 5 deletions
  1. 5 5
      session.py

+ 5 - 5
session.py

@@ -53,13 +53,13 @@ def checkIn():
     print('waiting 2 seconds for final page to load')
     time.sleep(2)
 
-    buttons =  driver.find_elements_by_xpath("//div[@class='uArJ5e UQuaGc Y5sE8d VkkpIf NqnGTe M9Bg4d']")
+    buttons =  driver.find_elements_by_xpath("//div[@role='button']")
     # find the submit button 
-    #buttonText = buttons[0].text
+    #buttonText = buttons[1].text
     pressSubmit = input("Press submit? (y/n)")
     if pressSubmit == "y":
-        print(buttons.text)
-        buttons.click()
+        print(buttons[1].text+" clicked!")
+        buttons[1].click()
         time.sleep(1)
         print("quitting")
         driver.quit()
@@ -69,7 +69,7 @@ def checkIn():
         #find back button
         backButton = driver.find_element_by_xpath("//div[@class='uArJ5e UQuaGc YhQJj zo8FOc IT3Lge']")
         print(backButton.text + " clicked.")
-        backButton.click()
+        buttons[0].click()
     else:
         print("invalid key pressed.")