|
-
Dec 5th, 2018, 11:18 AM
#1
Thread Starter
New Member
trouble changing value of an input box on a website with vba
I'm having an issue attempting to manipulate a website with vba. It is a secure website so I cant post it. I need suggestions i can test or if someone can explain what i'm missing.
so far i can open the website & login, no issue & i can click the button to navigate to the search screen, here i hit the wall. all i need to do is fill in a text box (then hit search). when i inspect the element on the text box I get:
however, it seems it's really a control group. this code:
Set HTMLInputs = HTMLDoc.getElementsByClassName
For Each HTMLInput In HTMLInputs
Debug.Print "ClassName:" & HTMLInput.className, "TagName:" & HTMLInput.tagName, "ID:" & HTMLInput.Id, "InnerText:" & LTrim(HTMLInput.innerText)
If InStr(HTMLInput.innerText, "Policy") > 0 Then
HTMLInput.value = "9509966270"
Exit For
End If
Next HTMLInput
looped successfully & found the field (i thought) but i cannot input into the text box. is it possible to tell what the item is that i'm looping thru in the elements collection? maybe i'm hitting a label not a text box. is it possible that its connected to the text box i want (it is the right text, just above it on the web page. i also saw something on using setattribute on an aria. any advice appreciated! thank you!
-Jim
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|