I was trying selenium recently and I need to find data on a first webpage. After that I need to go to an 2nd webpage and paste the data find on the 1st webpage.
But I can't transfer data from the first webpage, its look like the data in the variable getNumber
is lost in transit.
getNumber = driver.find_element(By.XPATH, '/html/body/section/div/div[2]/div[2]/div[2]/div[2]/div/div[4]/span/center/button')
print("Numéro de téléphone : ", getNumber.text) #THIS IS WORKING GREAT
driver.execute_script("window.open('');")
driver.switch_to.window(driver.window_handles[1])
driver.get("https://www.my2ndwebsite.com") #THIS IS WORKING GREAT
nmb = driver.find_element(By.XPATH, '//*[@id="useridInput"]')
nmb.send_keys(getNumber) #THIS IS NOT WORKING GREAT
If I put text like "test" instead my var getNumber, its perfectly working so the problem is my variable.
Can you help me please?