TAR
TAR

Reputation: 171

VBScript removing attributes from HTML input element

I am unsure if this is possible...I am currently working on a VBS script which fills in a web form and uploads a file. However, the upload button is a HTML input field of type "text"...The way I am planning to approach this is to remove the attribute type="file" and replace it with type="text". Then I am planning to populate the resulting text box with my file location and click upload afterwards. This works great when done manually through the browser developer tools.

However, I am limited to use of VBScript as the solution must be supportable by my colleagues. Has anybody got any ideas?

Upvotes: 1

Views: 356

Answers (2)

Aynos
Aynos

Reputation: 288

You can try:

IE.Document.getElementsByClassName("testYOYO").Item(1).removeAttribute(the Attribut)

Good Luck

Upvotes: 0

TAR
TAR

Reputation: 171

With some determination I stumbled through and produced an answer to my own Question:

IE.Document.All.Item("testYOYO").type = "text"

IE.Document.All.Item("testYOYO").value = "testtest"

Upvotes: 1

Related Questions