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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to Log URLs - IE history incomplete???

Status
Not open for further replies.

tx12345

Technical User
Jan 25, 2007
12
US
Hi

apparently IE does not have a complete listing of all URLs hit during navigation. for example, using IEHistory View, when i visit this one site, and hit just 3 pages, IE shows only 4 links traversed. However, when I use another prog, SoftX Logger, which is independent of IE, it logs *18* different URLs. The firefox history.dat file shows the same 18 as well, in this example.

naturally, IE does not have the URL i need, while the others do, and with VBA internet navigation one is stuck with IE.

i did a string search throughout my entire C drive (which took a long time) and looked in every file for a string from the desired link which i knew was in the history.dat file from firefox. sure enough, after the search was completed, the string ony appeared in two locations - the FF history.dat file and the log file for SoftX logger.

this leads me to believe that IE does not properly catalogue all navigated links, unless i am not looking inthe right lace.

so, i was wondering if there is a way to code VBA to grab URLs in the same fashion firefox does, or the SoftC logger program does.

here is an example of what i'd like to do:

Code:
'Turn logger on here


Set ie = CreateObject("InternetExplorer.Application")
With ie
.Navigate "[URL unfurl="true"]http://siteA.com"[/URL]
Do Until .ReadyState = 4: DoEvents: Loop
Do While ie.busy: DoEvents: Loop

'do stuff

.Navigate "[URL unfurl="true"]http://siteB.com"[/URL]
Do Until .ReadyState = 4: DoEvents: Loop
Do While ie.busy: DoEvents: Loop

'do more stuff

end with
'turn logger off

Basically i want to give up my epic search for the IE URL file, because it looks like it does not exist in the same beneficial form as the FF history.dat file, and create my own logger to run while i navigate from one site to the next.

any tips on this would be great. and if i have missed something about the way IE logs URLs and the location of that file, i'd be very interested to find out where that file is.

thanks

tx
 
point tx12345,
I believe that if you trap the [tt]DocumentComplete[/tt] event of the web browser you can see all the URL calls IE makes.
Code:
Private Sub ie_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Debug.print URL
End Sub
Here's the rub, I also seem to remember that IE only sinks to this this event if you use the AcriveX WebBrowser control.

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
thanks for the reply

i am not sure where to place your code - in a user form with a webbrowser?

tx
 
tx12345,
That's where I would start. I do something similar with a database that data mines from several websites and I know it returns most of the url's that IE calls when it loads a page (ad's, grapics...).

If you get really crazy and try it on an external browser window (and get it to work) post back because I would be curious to see your approach.

Regards,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top