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

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

如何在selenium c#中選擇要下載的相應附件

如何在selenium c#中選擇要下載的相應附件

C#
呼啦一陣風 2021-10-24 17:41:20
任何人都知道如何選擇要下載的附件中包含的特定元素,因為我無法選擇相應的附件。我放在下面的屏幕截圖:下面是特定容器的 html 代碼   <div class="attachment-wrap">      <!-- Comment Title -->                  <div id="attachmentTitle-wrapTEST" class="attachmentTitle-wrap">                    <h2>Attachments</h2>                 </div>      <div id="attachment-containerTEST"><!-- Attachment Box -->             <div class="comment-box">            <!-- Comment Image -->                <div class="col-xs-2">                  <div class="attachmentImg">                         <img src="downloadAttachment?attachmenturl=/secure/thumbnail/10104/_thumb_10104.png" />                                      </div>                </div>      <!-- Attachment details -->                <div  class="col-xs-10">                  <div class="commentContent">                    <div class="topRow">                      <div class="username">1177A149.PNG</div>                      <div class="commentTimeStamp">25927 KB</div>                    </div>                    <div class="bottomRow">                      <div class="commentDisplay">                        <a href="downloadAttachment?filename=1177A149.PNG&id=10104&mimeType=image/png" target="_blank">Download</a>                      </div>                    </div>                  </div>                </div>            </div>             <div class="comment-box">            <!-- Comment Image -->                <div class="col-xs-2">                  <div class="attachmentImg">                         <img src="downloadAttachment?attachmenturl=/secure/thumbnail/10103/_thumb_10103.png" />                                 </div>                </div>感謝您能幫我解決這個問題。
查看完整描述

2 回答

?
拉莫斯之舞

TA貢獻1820條經驗 獲得超10個贊

您創建特定于 png 名稱的 xpath??催@里

  //a[contains(@href,'downloadAttachment?filename=4D7746B6.PNG')]

它將指向具有 filename=4D7746B6.PNG 的下載鏈接


查看完整回答
反對 回復 2021-10-24
  • 2 回答
  • 0 關注
  • 238 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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