I am new to programming with Microsoft Visual Basic and am trying to create a program that will put co-ordinates into an image database website.
I am trying to put numbers into a specific space on a website.
The place that I would like to input a number for right ascension, doesn't have a specific ID when I inspect it on the website, so I tried getElementsByTagName, however, this isn't working.
I also looked to find an ID of a larger section of the HTML code as specified here: How to access HTML element without ID?, however that isn't working either.
Sub MovesData()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate "http://wsa.roe.ac.uk:8080/wsa/getImage_form.jsp? programmeID=&database=UKIDSSDR11PLUS&ra=&dec=&sys=J&filterID=all&xsize=1&ysize=1&obsType=object&frameType=stack&mfid=&fsid=&name="
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
IE.document.getElementsByTagName("ra").Value = "23"
End Sub
The HTML code for the specific line is:
<input type="text" name="ra" value="" size="15">
The section of HTML code is:
<td nowrap="" align="right"><b>RA</b> or <b>Galactic Long.:</b></td>
<td>
<input type="text" name="ra" value="" size="15">
<td><input type="text" name="ra" value="" size="15"></td>
I expect the output to be 23 in the right ascension box but it is just blank and there is a run time error 438 "Object doesn't support this property or method". Any help would be greatly appreciated!