Im just starting out with selenium
new_tab_url = driver.find_element_by_xpath(f'//*[@id="gridview"]/div[1]/div/table/tbody/tr[{i}]/td[5]/b/a')
new_tab_url.click()
^ this is the line of code responsible for retrieving the link to the next page. The link is in the href of the anchor tag whose display text is "View". This "View" is the same for all entries in the table, the xpath, on the other hand is unique. I can open this link . But when I try to retrieve data from this new tab, using driver.find_element_by_xpath I get the following error,
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//select[@id='District']/option[text()='Mumbai Suburban']"}
(Session info: chrome=86.0.4240.193)