CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2004
    Posts
    292

    Arrow Suggestions for DELL OUTLET REFRESHER

    The site is here.

    Actually I have already made a program that does it: automatically refresh the site and look for items that meets some criteria, eg. price, specs, ect, and automatically add them to cart. Now I just want to improve on the speed, the refreshing part seem slow since I am using the .Refresh method of the webbrowser control. I am looking for ways to improve the speed, I am experimenting with using 'createDocumentFromURL' method of the HTMLDocument object but encounters some problems with it. Perhaps I could use INET or winsock or some api's out there?

    I appreciate your suggestions...

    TIA
    Intelligent people talks because they have something to say,
    Fools talk because they have to say something....

  2. #2
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Re: Suggestions for DELL OUTLET REFRESHER

    unfortunately, it looks like the site itself is slow. as we all know .Refresh will just redownload the document from the site. i don't think using winsock/inet will speed things up.
    Last edited by Thread1; May 15th, 2007 at 10:48 PM.
    Busy

  3. #3
    Join Date
    Sep 2004
    Posts
    292

    Re: Suggestions for DELL OUTLET REFRESHER

    Actually there are many programs that does what I need and they are fast, they can be configured to search the site a few times per second so I am wondering what I am missing. I use the webbrowser control for this and the HTML objects to do the parsing so I could compare prices. Perhaps I could get the site's html then do the parsing before displaying it using the 'createDocumentFromURL' method of the HTMLDocument?

    I am open to any suggestions and I can even use a .Net language just to improve on it if necessary.
    Intelligent people talks because they have something to say,
    Fools talk because they have to say something....

  4. #4
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Re: Suggestions for DELL OUTLET REFRESHER

    uhum.. sounds like you would want to do a "pre-search" on the document before displaying its content. i think that's good to the fact that it will not resolve and download files/image from any external links.
    Busy

  5. #5
    Join Date
    Sep 2004
    Posts
    292

    Re: Suggestions for DELL OUTLET REFRESHER

    Yup, that is what I want and I am looking for ways to do just that. Can you suggest a very fast way to do just that?

    In .Net could I employ HTTPRequest object for this?
    Intelligent people talks because they have something to say,
    Fools talk because they have to say something....

  6. #6
    Join Date
    Sep 2004
    Posts
    292

    Re: Suggestions for DELL OUTLET REFRESHER

    Here is my idea...

    I'll use createDocumentFromURL to do the search since it's faster, my problem would be to syncronize the document object of the webbrowser with that of the HTMLDocument object created by createDocumentFromURL method, any one has some suggestion?
    Intelligent people talks because they have something to say,
    Fools talk because they have to say something....

  7. #7
    Join Date
    Sep 2004
    Posts
    292

    Re: Suggestions for DELL OUTLET REFRESHER

    No one?
    Intelligent people talks because they have something to say,
    Fools talk because they have to say something....

  8. #8
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Re: Suggestions for DELL OUTLET REFRESHER

    hey d-u, sorry for my late reply, been busy last weekend.. so you've settld with createdocumentfromurl. in that case, you can load it into the webbrowser as shown in the following code..

    Code:
    Dim doc As MSHTML.HTMLDocument
    Dim doc2 As MSHTML.HTMLDocument
      
      ' get document
      Set doc = New MSHTML.HTMLDocument
      Set doc2 = doc.createDocumentFromUrl("<URL>", vbNullString)
      Do Until doc2.ReadyState = "complete"
        DoEvents
      Loop
      
      ' load into webbrowser
      WebBrowser1.Silent = True
      WebBrowser1.Navigate "about:blank"
      WebBrowser1.Document.open
      WebBrowser1.Document.write doc2.documentElement.outerHTML
      WebBrowser1.Document.Close
      
      ' dispose
      Set doc2 = Nothing
      Set doc = Nothing
    Busy

  9. #9
    Join Date
    Sep 2004
    Posts
    292

    Re: Suggestions for DELL OUTLET REFRESHER

    Thanks Thread1, will try it out!

    Though I want to imply that I am open to other suggestions other than using createDocumentFromURL method... Perhaps the fastest way to get the source of a website, check for its content then output it to webbrowser...
    Intelligent people talks because they have something to say,
    Fools talk because they have to say something....

  10. #10
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Re: Suggestions for DELL OUTLET REFRESHER

    IMHO, winsock may be the fastest option for searching and analizing a web document but it may be the longest and hardest way to go since you have to implement the HTTP to talk with the server, and operate and parse the raw data manually. On the other hand, with the "createDocumentFromURL" you'll get the DOM instantly without the need of parsing and talking to the server. I think there is no much more differences.
    Busy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured