我需要你的帮助来用 selenium python 上传图片我有一个表格
<div class="none upload_no_autosubmit" id="upload_image_base_pack">
<div class="labelform inputfile">Choose</div>
<div class="lbcinputfile">
<input type="file" name="image0" id="image0" class="input_file">
</div>
<div class="clear"></div>
<div class="lbcinputfile_submit">
<input type="submit" class="button-upload" value="add" onclick="return disabled_onsubmit_photosupCheck('#image0', 'upload_image_base_pack');">
</div>
<div class="clear"></div>
</div>
<div class="message info right no_autosubmit" id="message_upload_image_base_pack">
我在 python 中使用 selenium,我想用这个上传图像文件
driver.execute_script("return disabled_onsubmit_photosupCheck('c:/1bo.jpg', 'upload_image_base_pack')")
请帮助tks
不工作
driver.execute_script("document.querySelector('#image0').setAttribute('value', 'c:/1bo.jpg', 'upload_image_base_pack')")
input_element = driver.find_element_by_css_selector("input[name='image0']")
input_element.send_keys("c:/1bo.jpg")
driver.find_element_by_css_selector("input[type='submit']").click()