1

I struggle to select the Tinder like button. I just copied the Xpath from the web version of tinder. It works for the Dislike button not for the like button. I've also tried to add a sleep button in case the like button didnt render quickly enough.

def dislike(self):
    dislike_btn = self.driver.find_element_by_xpath('//*[@id="content"]/div/div[1]/div/main/div[1]/div/div/div[1]/div/div[2]/button[1]')
    dislike_btn.click()

def like(self):
    like_btn = self.driver.find_element_by_xpath('//*[@id="content"]/div/div[1]/div/div/main/div/div[1]/div/div[2]/button[3]')
    like_btn.click()

I've tried to select by CSS Selector but that didnt work either.

I am an absolute noob, so have mercy if I missed out on some relevant infos :D

  • If you do a CTRL+F in the browser developer console and paste the xpath not recognised, does it find/highlight it? Also please add the relevant html source. – 0buz Feb 14 '20 at 18:29

1 Answers1

1

try clicking the element directly without assigning it. This is working for me and also check if there are any overlapping elements on the like button.

driver.find_element_by_xpath('//*[@id="content"]/div/div[1]/div/main/div[1]/div/div/div[1]/div/div[2]/button[3]').click()
VenuBhaskar
  • 84
  • 1
  • 8