title: I can't click the Like button in Instagram - Selenium Bot
body: <p>I am trying to create a bot that likes all pictures shown after a hashtag search. The bot works well until the liking part. I am new to Python and Selenium. Thank you.</p>
  <pre><code>        for k in range (3):
              # liking the pic (THIS IS THE PROBLEM)
              driver.find_element_by_xpath('//*[@id=&quot;react-root&quot;]/div/div/section/main/div/div[1]/article/div/div[2]/div/div[2]/section[1]/span[1]/button/div[1]/svg').click()
              time.sleep(5)
     
              # click on next media element
              next_button = driver.find_element_by_xpath('/html/body/div[6]/div[1]/div/div/div/button')
              next_button.click()
              time.sleep(1)
  </code></pre>