i am using selenium to open a site but inside site there is a hyperlink that opens a new tab. how can i take screenshot of that newly opened tab by navigating to it.
eg
import selenium.webdriver
import selenium.common
options = selenium.webdriver.firefox.options.Options()
# options.headless = True
with selenium.webdriver.Firefox(options=options) as driver:
driver.get('url')
time.sleep(2)
root=driver.find_element_by_tag_name('html')
root.screenshot('full page screenshot
But it does not work with new opened tab