Guest User

Untitled

a guest
Jan 25th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <a href="javascript:somewords('somelink',var1,var2,false)">Click here !</a>
  2.  
  3. Sub Connect_to_system()
  4.  
  5. Set IE = New InternetExplorerMedium
  6. Dim IEDoc As HTMLDocument
  7. Dim htmlTagCol As IHTMLElementCollection
  8. Dim Generic As HTMLGenericElement
  9.  
  10. With IE
  11. .Visible = True
  12. .navigate "http://example.com/login?username=johndoe&password=123"
  13.  
  14. Do Until .readyState = 4
  15. DoEvents
  16. Loop
  17.  
  18. .navigate "http://example.com/somepage.jsp?reference123"
  19.  
  20. Do Until .readyState = 4
  21. DoEvents
  22. Loop
  23.  
  24. Application.Wait (Now + TimeValue("0:00:10"))
  25.  
  26. Set tags = IE.document.getElementsByTagName("a")
  27. For Each tagx In tags
  28. If tagx.href = "javascript:somewords('somelink',var1,var2,false)" Then
  29. tagx.Click
  30. End If
  31. Next
  32.  
  33. End With
  34. End Sub
Add Comment
Please, Sign In to add comment