Use
selenium-webdriver-webelement.send_keys
Problems encountered
Read a Web page input box and take a string of numbers into the DataFrame read from pandas. Code
forin DF.iloc[:,11]: ele = browser.find_element_by_xpath("div[1]/div[2]/div/input") ele.clear() ele.send_keys(i)
The following issues were encountered:
File" d:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\remote\webelement.py ", line 351, in Send_keys {' Text ': "". Join (keys_to_typing (value)), File "D:\ProgramData\Anaconda3\lib\site-packages\selenium \webdriver\common\utils.py ", line-Max, in-keys_to_typing for I in Range (len): Typeerror:object of type ' numpy.int6 4 ' has no Len ()
Since pandas is based on NumPy, a string of numbers read from DF is naturally of a numpy.int64
type. Therefore, ele.send_keys(i)
you will be able to change ele.send_keys(int(i))
.
?
Problems encountered using ' Selenium-webdriver-webelement.send_keys '