Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 1st, 2005, 02:44 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default View Source from ActiveX Browser Object

Hi Everyone,

This one could be interesting. I need to do some data entry from a website that is less that user friendly.

What I would like to do, is be able to pull up the source code for a page and have functions written to find the necessary data and pull it out. With 3500+ records, the more automated the better!

I have the activeX browser on a form - Is there a way to capture the HTML Source of the current page, and put it into a text box?

Thanks

Mike

Mike
EchoVue.com
__________________
Mike
EchoVue.com
 
Old November 1st, 2005, 12:33 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Do you have the actual HTM pages stored locally? Or are you going out to the web and grabbing them?


mmcdonal
 
Old November 1st, 2005, 12:44 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Hi Michael,

I am going out to the web to retrieve them, which is the key to the problem. I got something kind of working last night - I have pasted it below...

I won't have access to the database till tonight, so I can't test it till then. This appears to get at least part of the page. A few test have just brought in a portions, but I am wondering if it is pulling the source before it is finished downloading, so perhaps a button which I could click once it is fully loaded may be a better idea - Let me know what you think, or if you have any better ideas. I did just notice a download complete event - I think I will try that. Also, do you by chance know where I could get some documentation on this control - I tried on msdn last night, but gave up after 30 minutes or so.

Thanks

Mike

Code:
Private Sub ocxBrowser_Updated(Code As Integer)
    On Error Resume Next
    strFile = "F:\DeleteMe.txt"
    Set objIE = Me.ocxBrowser.Object
    Open strFile For Output As #1
    Print #1, objIE.Document.body.innerHTML
    Close #1
    strURL = objIE.Name
End Sub
Mike
EchoVue.com
 
Old November 1st, 2005, 01:07 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Can you save the entire HTML file as a .txt file? If so you can crunch it line by line as a local text file. I can help with that.

I parse local text files and send the data to tables in one of my databases. Very common.

mmcdonal
 
Old November 1st, 2005, 01:13 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Saving the file is going to be the key. I do a lot of cruching as well, so I should be good there, but I'll be sure to contact you if I get stuck. I tried the Download complete event, and that seems to save most, if not all of the HTML from other pages, so I will have to try it out with the specific web-site tonight.

Let me know if you have any tips on saving the HTML as a text file that may work better than my patch up job above.

Thanks again,

Mike

Mike
EchoVue.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable View>Source (disable html source) kazmughal44 HTML Code Clinic 11 December 11th, 2007 11:53 AM
edit page in browser view. why? tomecord .NET Framework 1.x 1 March 26th, 2007 06:45 AM
Web Browser Activex Control gdelucchi Access 0 February 20th, 2006 02:18 PM
How to view MSAccess Reports in the browser minic Classic ASP Components 0 December 14th, 2004 02:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.