'TypeError: object of type 'numpy.int64' has no len() with Excel data
I'm currently working on automating some forms, and I got results, where all the fields were working and getting data from an Excel spreadsheet.
This is how I'm setting the fields:
for i in tabela.index:
NStaff = tabela.loc[i, "NStaff"]
NProf = tabela.loc[i, "NProf"]
NCONV = tabela.loc[i, "NConv"]
NColab = tabela.loc[i, "NColab"]
NAlun = tabela.loc[i, "NAlunos"]
NBenef = tabela.loc[i, "NBenef"]
This used to work and I have 12 other fields before them (radios, checkboxes, calendars, texts) all working.
But now I'm getting this error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_8560/1476198016.py in <module>
153 navegador.find_element(By.XPATH, '/html/body/div/div/div/div/div[1]/div/div[1]/div[2]/div[2]/div[11]/div/div[2]/div/div[2]/div/label/input').click()
154
--> 155 navegador.find_element(By.XPATH, '/html/body/div/div/div/div/div[1]/div/div[1]/div[2]/div[2]/div[12]/div/div[2]/div/div/input').send_keys(NStaff)
156 navegador.find_element(By.XPATH, '/html/body/div/div/div/div/div[1]/div/div[1]/div[2]/div[2]/div[13]/div/div[2]/div/div/input').send_keys(NProf)
157 navegador.find_element(By.XPATH, '/html/body/div/div/div/div/div[1]/div/div[1]/div[2]/div[2]/div[14]/div/div[2]/div/div/input').send_keys(NColab)
~\anaconda3\lib\site-packages\selenium\webdriver\remote\webelement.py in send_keys(self, *value)
539
540 self._execute(Command.SEND_KEYS_TO_ELEMENT,
--> 541 {'text': "".join(keys_to_typing(value)),
542 'value': keys_to_typing(value)})
543
~\anaconda3\lib\site-packages\selenium\webdriver\common\utils.py in keys_to_typing(value)
146 typing.append(val[i])
147 else:
--> 148 for i in range(len(val)):
149 typing.append(val[i])
150 return typing
TypeError: object of type 'numpy.int64' has no len()
-----
Anyone could give me any tips?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
