matrixhacker
07-18-2003, 02:43 AM
Hi Evryone! :cool: , as far as i can tell, the webbrowser control doesn't give the user the title of the webpage (i.e. <title> whatever</title>). it only gives location name and location url. in netscape, caption of the main 'form' uses the title and then "-netscape". i wanted to do this myself, so i used the Inet control to open the html up into a variable. Then i tried searching for the <title> and </title> so i count mid the text inbetween. see for yourself with the code below :D
Sub parsetitle()
Dim web_script As String
Dim title_start As Integer
Dim title2_start As Integer
Dim title_text As String
web_script = Form1.Inet1.OpenURL(Form1.wb1.LocationURL)
title_start = InStr(web_script, "<title>") + 7
If Len(title_start) > 0 Then
title2_start = InStr(webscript, "</title>") + 6
If Len(title2_start) > 0 Then
Form1.Label1.Caption = Mid(web_script, (title_start), (title2_start - title_script)) & " - Test Web Browser"
End If
End If
End Sub
for example. the thing that goes wrong is. when i go on www.google.com it returns "google - Test Web Browser" fine, and then when i search for something eg hello, it brings back a weird string eg '489gfndmd' on my title bar. when i look at the html for the hello search i look at the title and it should be "search google:hello"
can anyone help me out?
matrixhacker
Sub parsetitle()
Dim web_script As String
Dim title_start As Integer
Dim title2_start As Integer
Dim title_text As String
web_script = Form1.Inet1.OpenURL(Form1.wb1.LocationURL)
title_start = InStr(web_script, "<title>") + 7
If Len(title_start) > 0 Then
title2_start = InStr(webscript, "</title>") + 6
If Len(title2_start) > 0 Then
Form1.Label1.Caption = Mid(web_script, (title_start), (title2_start - title_script)) & " - Test Web Browser"
End If
End If
End Sub
for example. the thing that goes wrong is. when i go on www.google.com it returns "google - Test Web Browser" fine, and then when i search for something eg hello, it brings back a weird string eg '489gfndmd' on my title bar. when i look at the html for the hello search i look at the title and it should be "search google:hello"
can anyone help me out?
matrixhacker