Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get ONLY the title from a web page (url).

Status
Not open for further replies.

k0dy

Programmer
Feb 26, 2006
7
US
Hi all,

Here's the facts.
I have a webbrowser that refreshes a page every 3 seconds and searches for the page title (WebBrowser1.Document.Title). If the title changes to something else, let's say "File not found" something else will happend.
I've done that using:
If WebBrowser1.Document.Title = "File not found" Then ...
BUT it will cost me alot of computer and internet resources to refresh it every 3 seconds and I only need the title. How can I do that ? Remember that I want to keep the webbrowser.
 
Or at least not to load the pictures will be helpfull.
 
If a page is down, then the only option you have is to keep trying it until it is up. You might want to ping the server first to see if it is up, but traffic could prevent the page from displaying for you, so that might not be the best option, as the site would always be up.

-David
2006 Microsoft Valueable Professional (MVP)
2006 Dell Certified System Professional (CSP)
 
Sorry because I have misslead you with that example of page title. So the page title can be "Second Title" so the page and server are still up and running just that on a certain moment the title will change.
So again the URL is the same, page exists, server is running, but will change the title.

Example: <title>First Title</title> will change after ... let's say 5 minutes to <title>Second Title</title>
 
The webbrowser has a TitleChange event that you can respond to instead of polling
 
Thanks, didn't knew that. I'll start digging to find out how exactly can I use this event. I hope that will still connect to server to find whenever or not the title has changed.
 
I tryed to search more about this TitleChange event, I see that it exists but I cannot figure exactly how it works.
It sais that" Fires when the title of a document in the object becomes available or changes " but it's not enough for me. Can anyone clear this out for me ?
 
You will have noticed that the event has a parameter:

Private Sub Webbrowser1_TitleChange(ByVal sText As String)

Help says:
sText
String that specifies the new document title.

Suggest you also read faq222-2244 where you will find guidelines on basic research and forum usage.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top