Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99434

How do I solve this error using Python to insert text into a form control / dropdown? [duplicate]

$
0
0

This question already has an answer here:

I'm attempting to do my first web scraping project in Python using Firefox. I'm using Python version 3.7.4 and Firefox Developer 71. Both are 64 bit and I'm using Windows 10.

The problem is trying to access this form control via python. Ultimately I'd like to insert text into the form control and then web scrape the results. However, I'm just trying to click on the object at the moment since it's playing hard to get.

Here is my code:

from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
import time

driver = webdriver.Firefox()
driver.get("https://www.website.com/login/")

jcode_form = driver.find_element_by_id('ndcCode')
hov = ActionChains(driver).move_to_element(jcode_form)
time.sleep(6)  
hov.click()  
hov.perform()  

The error I'm receiving says:

WebDriverException: Message: TypeError: rect is undefined

Here is what I'm seeing on my browser

The object I'm trying to work with is the form control at the top.

I've tried to troubleshoot this in a number of ways using action chains and the sleep function, but I keep receiving an error message.

Any help or suggestions would be greatly appreciated. Thank you.


Viewing all articles
Browse latest Browse all 99434

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>