Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

SELENIUM WEBDRIVER SWITCH POPUP

HEY, I need a code that will change from the main window to the POPUP window (below adds a picture of the POPUP window), then do one action, and
closes the POPUP window and returns to the main window.
Thank you in advance for any help!!
CODE:
Code
driver.find_element_by_xpath('//*[@id="login"]/fieldset/table/tbody/tr[8]/td/a').click()
sleep(20)

driver.find_element_by_xpath('/html/body/div[6]/div[2]/div[2]/div[1]/div/div/table/tbody/tr[5]/td[1]/div/div[2]/div/span/a').click()
sleep(7)

driver.switch_to().window(driver.windowhandles.toList().last())
sleep(3)

driver.find_element_by_xpath('//*[@id="react-root"]/section/main/div/header/section/div[1]/a/button').click()
driver.switch_to().window(driver.windowhandles.toList().first())
driver.SwitchTo().DefaultContent();
WINDOW POPUP:
https ://imgur.com/qTnXahN (without space after https)r


Possibly Related Threads...
Thread / Author Replies Views Last Post
by C1ph3rpunkNov 21, 2023 07:25 PM 0 117 Nov 21, 2023 07:25 PM
Last Post: C1ph3rpunk
by GlowmanNov 8, 2023 06:45 AM 5 341 Nov 8, 2023 06:45 AM
Last Post: hssamconf007
by RubbaDuckySep 3, 2019 07:34 AM 0 229 Sep 3, 2019 07:34 AM
Last Post: RubbaDucky