我正在使用Python处理Selenium,使用Chrome。当我到达图片上传的部分时,我会执行以下操作:
pictureChange = driver.find_element_by_xpath("//input[@class='custom-file' and @type='file']")
photoLocation = [I enter the file location on my locally mapped drive]
pictureChange.send_keys(photoLocation)
这似乎符合
像这样的代码(上传图片时执行):
gallery = Gallery.objects.get(id=album_id)
index = gallery.photo_num +1 #index will be used in later
gallery.photo_num = index
gallery.save()
1张图片上传效果很好,但如果同时上传多张图片,使用多张上传jQuery plugin.the "gallery.photo_num“会比较混乱
如何修改代码以避免此问题