다음 내용으로 고생하고 있습니다.internetexplorer.application document.getElementByID는 null/Powershell을 반환합니다.
HTML 추출물을 보면 ID는 있지만 null 표현식을 계속 반환합니다. 불행히도 나는 웹 사이트에 대한 자세한 내용을 드릴 수 없습니다 ... 뭐가 잘못 되었는가?
--- HTML의 추출 ----
<input name="ctl00$mainCopy$LoginView$LoginControl$UserName" type="text" id="ctl00_mainCopy_LoginView_LoginControl_UserName" tabindex="1" class="txtBox" onchange="document.getElementById('ctl00_mainCopy_LoginView_LoginControl_PasswordResetLink').disabled
= false;" style="width:150px;" />
--- 스크립트 ---
$ie = New-Object -com internetexplorer.application
$ie.visible = $true
$ie.navigate("excluded for security")
$ie.document.getElementByID("ctl00_mainCopy_LoginView_LoginControl_UserName").Value= "excluded for security"
---- 오류 ----
당신은 할 수 없습니다 null 값을 가지는 식의 메서드를 호출합니다. 줄에 : 1 문자 :. 1 + $ ie.document.getElementByID ("ctl00_mainCopy_LoginView_LoginControl_UserName") 버지니아 ... + ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ + CategoryInfo : InvalidOperation (:) []의 RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull
나를 위해'$ ie.Busy'는 속성으로만 작동하며 코드 스 니펫과 같은 메소드 호출로 작동하지 않습니다. – esel
맞습니다. 그 답을 쓴 이후로 변경되었을 수도 있습니다. –