我有几千行历史数据,我想让Excel访问。 此数据将用于创建摘要报告,迷你图和表格数据。 我的问题是我应该如何向数据源添加新行? 需要Powershell才能从源(Exchange Server)提取数据...但是如何将提取的数据显示到Excel2010? 这是我的想法: ...
提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供 中文繁体 英文版本 中英对照 版本,有任何建议请联系yoyou2525@163.com。
我正在尝试编写将与网页元素进行交互的Powershell脚本。 为了学习脚本的概念,我使用Armorgames.com作为目标URL,旨在使用powershell登录该站点,然后根据指定的搜索词搜索可用的游戏,然后将结果导出到CSV 。 所附的代码示例是我目前拥有的。 但是我无法理解我要搜索的网页元素的哪些部分以及如何将值输入到可用字段中。 我也收到错误消息“由于[mshtml.HTMLDocumentClass]不包含名为'getElementsById'的方法,所以方法调用失败”,并且我不明白为什么
$ie = New-Object -ComObject "InternetExplorer.Application"
$requestUrl = "https://armorgames.com/"
$userId = "username-input";
$passwordId = "password-input"
$signIn = "act"
$ie.visible = $true
#ie.silent = $true
$ie.navigate($requestUrl)
while ($ie.busy) {
Start-Sleep -Milliseconds 100
}
$doc = $ie.Document
$doc.getElementsById("input") | % {
if ($_.id -ne $null){
if ($_.id.Contains($signIn)) { $btn = $_ }
if ($_.id.Contains($passwordId)) { $pwd = $_ }
if ($_.id.Contains($userId)) { $user = $_ }
}
}
$user.value = "ExampleUser"
$pwd.value = "MyPassord"
$btn.disabled = $false
$btn.click()
Write-Output $ie
Write-Output "doc is $doc"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.