我编写的用于将数组列表发送到内部站点中的文本框的代码。其中数组的输入来自excel。
value = [] // ArrayList
while len(value)<1000:
Data=sheet.row(loop)
T1 = Data[1].value
T2=int(T1) // to remove float values
T2 = str(T2) // as the text-box is only accepting the strings
value.append(T2)
loop += 1 //to read the next row in the excel sheet.
driver.find_element_by_xpath('//*[@id="operand.action_(id=7)"]').send_keys(values[0:])
发送到文本框的值的格式为:['40554666','40554539','40554762','40554806']
这给了我一个错误,因为上面的代码以错误的格式将值发送到文本框,我需要删除“''”和“[%”文本框只能接受以逗号分隔的数字或新行中的数字。
注意:我试图一次发送一个元素,但这对我的网站不是有效的解决方案。这就是我一次发送1K值的原因。
有人能帮我一下吗?