1

I am trying to close a pop-up message, tried to copy the xpath of the X button on the left corner but no luck, tried switch to different frame no luck also.

What should I try next?

This is what I get when I copy the xpath of the button:

//*[@id='Layer_1']

This is a the relevant part of my script:

        iframes = self.browser.find_elements_by_tag_name("iframe")
        self.browser.switch_to.frame(iframes[1])
        time.sleep(5)
        self.browser.find_element_by_xpath("//*[@id='Layer_1']").click()

Output:

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id='Layer_1']"}
  (Session info: chrome=87.0.4280.66)
ChristianYami
  • 588
  • 1
  • 8
  • 17
BullBazour
  • 19
  • 1

0 Answers0