|
-
Jan 20th, 2000, 12:56 PM
#1
I want to make a webrowser that at start is just a text browser but then I search through and find the tags which i then translate. How would i go about doing this?
-
Jan 20th, 2000, 06:36 PM
#2
Here is an exmple i wrote some time ago:
Code:
Option Explicit
Private Sub Form_Load()
MsgBox HTMLParser("<p><ul><b>This is the text you would see in the web browser.<br>Test.</b></p><br>This is the end")
End Sub
Private Function HTMLParser(ByVal sHTML As String) As String
Dim lCounter As Long
Dim sTemp As String
For lCounter = 1 To Len(sHTML)
Select Case Mid(sHTML, lCounter, 1)
Case "<"
'Found a tag, should probably do something with it
Select Case LCase$(Mid$(sHTML, lCounter, 4))
Case "<br>", "</p>" 'These tag's as handled
'<br>, is next line; </p> is end paragraf
sTemp = sTemp & vbCrLf
lCounter = lCounter + 3
Case Else 'Unknown tag, skip it
Do Until Mid(sHTML, lCounter, 1) = ">"
lCounter = lCounter + 1
Loop
'End Case
End Select
Case Else
sTemp = sTemp & Mid(sHTML, lCounter, 1)
'End Case
End Select
Next
HTMLParser = sTemp
End Function
------------------
Vincent van den Braken
EMail: [email protected]
ICQ: 15440110
Homepage: http://www.azzmodan.demon.nl
-
Jan 21st, 2000, 03:18 AM
#3
yea thats fine but i want to know how to get the source code. I know how to parse it.
-
Jan 21st, 2000, 06:25 PM
#4
Addicted Member
OK. You will need to use the internet transfer control:
Dim b() As Byte
b() = Inet1.OpenURL("myurl.com",icByteArray)
For intCount = 0 To UBound(b) - 1
strSource = strSource & Chr(b(intCount))
next
The variable strSource now contains the HTML source code.
------------------
"To the glory of God!"
-
Jan 22nd, 2000, 10:12 AM
#5
ive tried that before but sometimes the source code is too big and it wont get it all.
-
Jan 22nd, 2000, 01:50 PM
#6
I had that once to, i beleive i addaded a doevents in the inet_statechanged and that seemed to work.
(I don't think it had anything to do with it, but i might help.)
------------------
Vincent van den Braken
EMail: [email protected]
ICQ: 15440110
Homepage: http://www.azzmodan.demon.nl
-
Jan 23rd, 2000, 05:17 AM
#7
a do events? can you further elaborate?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|