Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. <a title="" href="/player-profiles/ashley-barnes/" data-hasqtip="19" oldtitle="Ashley Barnes">Barnes (Ashley)</a>
  2.  
  3. Public Sub parsehtml()
  4.  
  5. Set html = CreateObject("HTMLFile")
  6.  
  7. html.body.innerHTML = "<a title="""" href=""/player-profiles/ashley-barnes/"" data-hasqtip=""19"" oldtitle=""Ashley Barnes"">Barnes (Ashley)</a>"
  8.  
  9. MsgBox html.getElementsByTagName("a")(0).innerText 'Barnes (Ashley)
  10.  
  11. End Sub
  12.  
  13. Sub ShowMe()
  14. Dim html As String
  15. html = "<a title="""" href=""/player-profiles/ashley-barnes/"" data-hasqtip=""19"" oldtitle=""Ashley Barnes"">Barnes (Ashley)</a>"
  16.  
  17. Dim pos1 As Long
  18. Dim pos2 As Long
  19. Dim nameOnly As String
  20. pos1 = InStrRev(html, "</a>")
  21. pos2 = InStrRev(html, ">", pos1) + 1
  22. nameOnly = Mid$(html, pos2, pos1 - pos2)
  23. Debug.Print nameOnly
  24. End Sub
  25.  
  26. Public Function KillJunk(S As String) As String
  27. Dim L As Long, s2 As String, CH As String
  28. Dim Ignore As Boolean, i As Long
  29.  
  30. Ignore = False
  31. L = Len(S)
  32.  
  33. For i = 1 To L
  34. CH = Mid(S, i, 1)
  35. If CH = "<" Then
  36. Ignore = True
  37. End If
  38. If Ignore Then
  39. If CH = ">" Then
  40. Ignore = False
  41. End If
  42. Else
  43. s2 = s2 & CH
  44. End If
  45. Next i
  46. KillJunk = s2
  47. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement