def login(self):
self.driver.get('https://www.tinder.com')
sleep(6)
login_homepage = self.driver.find_element_by_xpath('//*[@id="c-1804602209"]/div/div[1]/div/main/div[1]/div/div/div/div/header/div/div[2]/div[2]/a/span')
login_homepage.click()
more_options = self.driver.find_element_by_xpath('//*[@id="c761984011"]/div/div/div[1]/div/div/div[3]/span/button')
login_fb = self.driver.find_element_by_xpath('//*[@id="c761984011"]/div/div/div[1]/div/div/div[3]/span/div[2]/button')
login_phone = '//*[@id="c761984011"]/div/div/div[1]/div/div/div[3]/span/div[3]/button/span[2]'
sleep(3)
identify_login_type = self.driver.find_element_by_css_selector(login_phone)
s = len(identify_login_type)
if(s>0):
login_fb.click()
else:
more_options.click()
sleep(0.5)
login_fb.click()
Hello. I am trying to make a bot that automatically logs in into tinder. However, the login page of tinder is randomized. Some times it only gives the option to log in with google and a "more options" button to get the Facebook option, and some times it already gives the Facebook option without needing to click on "more options". So is there a way I can search that if the more options button is available, it clicks on that but if its not then directly log onto fb. I tried a different method where the "login with phone" option is there or not, and accordingly an if/else block would be executed. the login with phone option is automatically there if "more options" is not there. But when "more options" button is there, with only google as choice you can click on more options and get all 3 buttons, google, fb and Facebook. However this did not work. Also if I just add a click function for the more options button assuming that it will not click if it does not exist, it actually ends up clicking the recovery account button when it gives out all 3 options randomly.