0
我试图去以下几点:文件处理蟒蛇硒自动化错误
<button id="plupload" class="newupl" style="position: relative; z-index: 1; opacity: 1;">Add Images</button>in the attached source code
我使用下面的代码与硒的网络驱动程序,但该文件没有被上传,因为我会喜欢它是:
imageFolder = '/Users/jmath/Desktop/DevelopmentStuff/PythonFiles/climages/'
for files in os.walk(imageFolder):
for imgfile in files[2]:
if imgfile.endswith(".jpeg"):
print(imgfile)
driver.find_element_by_xpath('/button[@class="newupl"').send_keys(imageFolder + imgfile)
乔纳森,通常情况下,有一个隐藏的元素的地方,实际上是接受文件名“输入”元素。这通常是您必须执行发送密钥的地方。你可以在该元素周围的元素树中查看一下,看看是否可以找到隐藏的输入。它通常具有“文件”的@type属性。 –