I have been trying to write the code to print the preview present under Fetch/XHR tab which is present under Networks Tab. The image is present below-
In this image I want to print on the console after selecting the audio button under captcha.
The link for the website is- https://tmrsearch.ipindia.gov.in/eregister/
On this site first you have to select the first button on the left “Trade Mark Applications/Registered Mark”
After that select the National/IRDI Number checkbox to go to the desired page
The desired page is-
After inspecting the element, when you will click the audio button below the captcha, you will get to see the captcha in the preview tab under XHR/Fetch tab under Network tab. The captcha code will appear in the preview tab.
I have already created a python code that takes to the desired page.
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver=webdriver.Chrome()
driver.maximize_window()
driver.get("https://tmrsearch.ipindia.gov.in/eregister/")
wait = WebDriverWait(driver, 10)
# switch into the frame context
wait.until(EC.frame_to_be_available_and_switch_to_it((By.NAME, "eregoptions")))
# click on the targeted element
wait.until(EC.element_to_be_clickable((By.ID, "btnviewdetails"))).click()
# come out of frame
driver.switch_to.default_content()
time.sleep(10)
wait.until(EC.frame_to_be_available_and_switch_to_it((By.NAME, "showframe")))
# click on the targeted element
wait.until(EC.element_to_be_clickable((By.ID, "rdb_0"))).click()
# come out of frame
driver.switch_to.default_content()
time.sleep(10)
I want to add lines of code that can print the captcha under Preview tab under Fetch/XHR under Network Tab.