html - 单击具有 powershell 自动化功能的按钮
问题描述
无法单击按钮,我尝试的一切都不起作用。
$ie.Document.IHTMLDocument3_getElementByID("save_desktop").click()
和
$Link=$ie.Document.getElementsByTagName("span") | where-object {$_.type -eq "Save / Print this bill (PDF)"}
$Link.click();
和
$ie.Document.IHTMLDocument3_getElementByID('save_desktop') | select -first 1).click()
它需要第一部分,但它不喜欢.click,我也尝试过.submit,似乎没有任何效果!
<span class="tip ng-binding" id="save_desktop" style="color: black
!important;">Save / Print this bill (PDF)</span>
错误:
您不能调用空表达式
方法调用失败,因为 [System.DBNull] 不包含名为“click”的方法。在 line:1 char:1 + $ie.Document.getElementById('save_desktop').Click()
我添加了更多信息:
> <span class="print-save-pdf-link ng-scope"
> ng-click="bbTrackData('events',true,'bill:save:print this bill')"
> tooltip-trigger="click" tooltip-placement="bottom-left"
> tooltip-html-unsafe="<div
> class="downloadPdfEbuText">Download:</div><div
> class="d-iflex"><i
> class="cus-icon-rogers_overlay-arrow-circle"></i><span
> onclick="downloadCompleteBill('14161234567-123456789')"
> class="downloadPdfEbuLink-rogers">Complete
> bill</span></div><div class="d-iflex"><i
> class="cus-icon-rogers_overlay-arrow-circle"></i><span
> onclick="downloadAccountSummary('1-1234-5678','24092019')"
> class="downloadPdfEbuLink-rogers">Account
> summary</span></div>"><i class="cus-icon-download"></i><span
> class="tip ng-binding" id="save_desktop" style="color: black
> !important;">Save / Print this bill (PDF)</span></span>
解决方案
推荐阅读
- elasticsearch - 邮递员中的“mapper_parsing_exception”错误
- windows - 哪个 Windows SDK 是最新的与 Visual Studio 97 和 Windows 9x 兼容
- r - 闪亮的外部传单地图
- android - Firebase Analytics 日志事件甚至一天都无法在仪表板中向我显示自定义捆绑包值
- python - 将代码从 Python 转换为 Julia 后,代码无法正常工作
- c - 分段错误(核心转储)但不知道如何修复
- data-structures - 给定 k 个已排序的数组,从每个数组中选择一个元素,使得所选元素的最大和最小元素之差最小
- sqlite - Sqlite:如何将总数的百分比作为一列
- visual-studio - Visual Studio 2019 Code-Formatter "Ctrl+K / Ctrl +D" 弄乱 HTML 代码
- python - 以上限值为 y 值的增长/动画条形图