1

So I am using powershell to search a database that is based in HTML. The HTML with the checkbox is:

INPUT name=extend id=perextend onchange=javascript:disabledPagination(); type=checkbox value=on

Now i have search and tried different options, but still no luck:

$chk = $ie.Document.getElementsByTagName("extend") | where-object {$_.type -eq "checkbox"}
$chk.Checked = $True

But it give me an error:

Property 'Checked' cannot be found on this object; make sure it exists and is se ttable. Property 'Checked' cannot be found on this object; make sure it exists and is settable. At D:\Data\Argos excel\Untitled1.ps1:51 char:1

+ $chk.Checked = $True
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound

Any help would be great. And sorry I am new to powershell if its a common mistake

1 Answer 1

1

It seems that i was assigning it the wrong element and looking at debugger:

<td width="230"><input type="checkbox" name="extend" value="on" onchange="javascript:disabledPagination();" id="orgextend">

Then using the ID and .Checked = $true has solved my issue:

$chk = $ie.Document.getElementById("orgextend").Checked = $true 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.