My current code opens a website and logins. the next step is that I want to select a link on the next page but don't know how to get the code to click on it (first time messing with HTML code). below is a picture of the HTML behind that link. If more info is needed I can update with more pictures.
<td align="left" style="vertical-align: top;"> <div class="gwt-Hyperlink">PRC search by selection</div> </td> My Excel code:
Sub Login() Dim ie As Object Set ie = CreateObject("InternetExplorer.Application") ie.Visible = True ' ie.navigate "http://sqa.subaru-sia.com/nxps/nxps?action=defaultPage" ' Modify the URL here.... Const Url$ = "http://sqa.subaru-sia.com/nxps/nxps?action=defaultPage" Dim UserName As String, Password As String, LoginData As Worksheet UserName = "xxxxxxx" Password = "xxxxxxx" With ie .navigate Url ieBusy ie .Visible = True Dim oLogin As Object, oPassword As Object Set oLogin = .document.getElementsByName("j_username")(0) Set oPassword = .document.getElementsByName("j_password")(0) oLogin.Value = UserName oPassword.Value = Password .document.forms(0).submit End With Do While ie.Busy Application.Wait DateAdd("s", 1, Now) Loop Set myColl = ie.document.getElementsByTagName("div") For Each myItm In myColl Cells(i + 1, 1) = "Table# " & ti + 1 ti = ti + 1: i = i + 1 For Each trtr In myItm.Rows For Each tdtd In trtr.Cells 'Debug.Print (tdtd.innerText) If tdtd.innerText = "PRC search by selection" Then tdtd.Children(0).Click End If j = j + 1 Next tdtd i = i + 1: j = 0 DoEvents Next trtr i = i + 1 Next myItm 'ie.Quit End Sub Sub ieBusy(ie As Object) Do While ie.Busy Or ie.readyState < 4 DoEvents Loop End Sub 
