Im pretty new to python and trying to fill out a web form automated.
Im getting this Error:
Traceback (most recent call last): File "main.py", line 24, in ActionChains(browser)\ NameError: name 'ActionChains' is not defined
And this is my code:
from time import sleep
from selenium import webdriver
browser = webdriver.Chrome ('/Users/max/Downloads/chromedriver')
browser.get ('http://www.brix.de/computer/web_html_php_et_al/formular-test_smm_01.html')
inputs = browser.find_element_by_xpath(
'/html/body/form[1]/table')
ActionChains(browser)\
.move_to_element(input[vorname]).click()\
.send_keys('name')\
.move_to_element(input[name]).click()\
.send_keys('Surname')\
.perform()
Can somebody help me please?
I think you are missing the import, try the following:
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
browser = webdriver.Chrome ('/Users/kiran/Downloads/chromedriver')
browser.get ('http://www.brix.de/computer/web_html_php_et_al/formular-test_smm_01.html')
inputs = browser.find_element_by_xpath(
'/html/body/form[1]/table')
ActionChains(browser)\
.move_to_element(input[name]).click()\
.send_keys('name')\
.move_to_element(input[vorname]).click()\
.send_keys('Surname')\
.perform()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With