Powershell 即 com 对象 html 到变量

问题描述

我正在向德克萨斯州申请特殊许可证。我正在尝试编写一个脚本,该脚本每两个小时检查一次,以查看在线申请状态中的任何内容是否已更改。我已经知道它会访问网站,填写我的驾照、出生日期和电话号码,然后登录该网站。我的主要问题是现在我试图从 ie com 对象中获取 html 并将其全部放入一个变量中。我将发布我拥有的代码(已删除个人信息)。我真的想要 ul,li 用于指纹和背景检查,但我会用所有的 html 数据来代替。

function IEcheck() {
    $StartUrl = "https://txapps.texas.gov/txapp/txdps/ltc/"
    $ie = New-Object -ComObject internetExplorer.Application
    $ie.visible = $true
    $ie.Navigate($StartUrl)
    Start-Sleep -Seconds 5
    while ($ie.busy) {Start-Sleep -Seconds 5}
    $MainPage = $ie.Document.getElementByID('renew-trigger')
    $MainPage.click()
    Start-Sleep -Seconds 5
    while ($ie.busy) {Start-Sleep -Seconds 5}
    $SecondPage = $ie.Document
    $DriverLicenseField = $SecondPage.getElementByID('DL')
    $DriverLicenseField.value = "00000000"
    $BirthDateField = $SecondPage.getElementByID('dob')
    $BirthDateField.value = "01/01/0001"
    $PhoneNumberField = $SecondPage.getElementByID('PHONE')
    $PhoneNumberField.value = "0000000000"
    $clickButton = $ie.Document.getElementByID("continue")
    $clickButton.click()
}

IEcheck

进入页面后,如果我执行“查看页面源代码”,我将无法找到我要阅读的字段,但如果我检查元素,我可以找到该字段。有没有办法像从powershell中的ie com对象的inspect元素部分导出html一样?同样,我只是在寻找一种从指纹中提取文本的方法:审核中

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)