1

I'm trying to comment on Instagram posts.

But my code doesn't work and I get this error:

selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document (Session info: chrome=104.0.5112.79)

comment_box = self.driver.find_element(
    By.XPATH,
    "//textarea[@placeholder='Add a comment…']"
)

# comment_box.click()
# comment_box.clear()
comment_box.send_keys("Message")
AliAryaie
  • 107
  • 1
  • 8

0 Answers0