亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

無法使用 Selenium 上傳文件

無法使用 Selenium 上傳文件

江戶川亂折騰 2022-06-14 10:14:51
我有以下用于文件上傳的 HTML。<div class="drop-zone hand-cursor ng-pristine ng-untouched ng-valid ng-empty" ngf-select="" ngf-drop="" data-ngf-pattern=".pdf" data-ngf-accept="application/pdf" data-ng-model="vm.siteVo.signed_order_form">    <!-- ngIf: !vm.siteVo.signed_order_form -->    <div ng-if="!vm.siteVo.signed_order_form" class="ng-scope"><i class="material-icons primary-color font-size-40">backup</i>        <br><span class="color54 font-size-16 ng-binding">Drag and drop file here or click to open explorer</span></div>    <!-- end ngIf: !vm.siteVo.signed_order_form -->    <!-- ngIf: vm.siteVo.signed_order_form --></div>我嘗試了以下方法來定位driver.find_element_by_css_selector(".drop-zone > .ng-scope").send_keys("file path")但出現以下錯誤selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable  (Session info: chrome=77.0.3865.90)
查看完整描述

1 回答

?
阿波羅的戰車

TA貢獻1862條經驗 獲得超6個贊

已解決:inputwithtype file不在同一個div頁面中,而是隨機放置在頁面中。使用 xpath 定位并直接使用send_keys()



查看完整回答
反對 回復 2022-06-14
  • 1 回答
  • 0 關注
  • 97 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號