Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 1st, 2005, 01:44 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
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
Reply With Quote
  #2 (permalink)  
Old November 1st, 2005, 11:33 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #3 (permalink)  
Old November 1st, 2005, 11:44 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
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
Reply With Quote
  #4 (permalink)  
Old November 1st, 2005, 12:07 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #5 (permalink)  
Old November 1st, 2005, 12:13 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable View>Source (disable html source) kazmughal44 HTML Code Clinic 11 December 11th, 2007 10: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 01:18 PM
How to view MSAccess Reports in the browser minic Classic ASP Components 0 December 14th, 2004 01:42 AM



All times are GMT -4. The time now is 05:34 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.