Page 1 of 3 123 LastLast
Results 1 to 40 of 88

Thread: I need to get data form a web page

  1. #1

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry I need to get data form a web page

    hi
    I need to get data form http://www.upcdatabase.com

    By ueing 07800008846
    Manufacturer Dr Pepper/Seven-Up Inc
    how do I open upcdatabase-2005.02.01-2005.03.01.diff in vb 6.0
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  2. #2
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: I need to get data form a web page

    what is the data you need? is it always different? is there anything constant around it?

  3. #3

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: I need to get data form a web page

    UPC number
    Description line
    Size/Weight
    Entered/Modified
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  4. #4
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: I need to get data form a web page

    well, i dont see it on that page so i cant really help you...

  5. #5

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: I need to get data form a web page

    hi
    did use the number 07800008846?
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  6. #6
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: I need to get data form a web page

    okay i see, the site uses javascript or something to change pages, im not sure how to help you in that case...

  7. #7

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: I need to get data form a web page

    all I need is the code in vb 6.0
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  8. #8
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: I need to get data form a web page

    yes i understand, but i cant help you with it

  9. #9

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: I need to get data form a web page

    ok ok
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    To clarify, can you use the web browser control for this? If you can then you can load the page and
    automate the entry of upcs.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #11

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: I need to get data form a web page

    how do you do it?
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    Add the web control to your project toolbox by clicking Project > Components > Controls tab >
    and select "Microsoft Internet Control".
    Then add an instance of it to your form.

    Next we need to setup some properties so we get that upc page to load into our browser.

    ...
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  13. #13
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    This should get you started.

    Try a search on the Forums. There was this member vivek.shakur that was doing allot of browser automation.
    Forget it, I will post a link in a minute.

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.     WebBrowser1.Navigate2 "http://www.upcdatabase.com/nocheckdigit.pl"
    5. End Sub
    6.  
    7. Private Sub Form_Resize()
    8.     If Me.WindowState <> vbMinimized Then
    9.         WebBrowser1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
    10.     End If
    11. End Sub
    Last edited by RobDog888; Mar 22nd, 2005 at 10:30 PM.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  14. #14

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: I need to get data form a web page

    run-tim error 424.
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  15. #15
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    Did you add the web browser to your form and is it named the same?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  16. #16

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: I need to get data form a web page

    yes!
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  17. #17
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    Sorry, in the resize event I had a different name for the control. I updated the code now.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  18. #18
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    Do you get the upc page loaded into your web browser form now?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  19. #19

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: I need to get data form a web page

    now I need to seva the data in to a file upc.dat
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  20. #20
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    We need to enter the data into the textbox and click the button first?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  21. #21

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: I need to get data form a web page

    yes!
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  22. #22
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    Ok, I was checking out the web browser control for this and its a bit limited. So I think we need to reference
    Internet Explorer to get the full control. Give me a minute.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  23. #23

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: I need to get data form a web page

    how do I do it
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  24. #24
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    Still there? I almost got it. This is cool control over IE . Just fixing a couple of
    things but will be done soon.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  25. #25

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: I need to get data form a web page

    http://return.no-ip.org/dalehnews/crnc_news/show_kb.asp?topicID=16&catID=6&catname=Programming%20(for%20POS%20Affiliates)%20-%20Advanced%20Users
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  26. #26
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    I think this is the first step. It loads the page into the forms web browser. Then upon the command1 click
    it will enter the upc into the web page's textbox and sends an enter keypress. Then the page returns
    with the upc data.

    VB Code:
    1. Option Explicit
    2. 'Add component to Microsoft HTML Object Library
    3. 'Add component Microsoft Internet Controls
    4.  
    5. 'Add a command button (Command1)
    6. 'Add a web browser control to the form (WebBrowser1)
    7. Dim hDoc As MSHTML.HTMLDocument
    8. Dim hInp As MSHTML.HTMLInputElement
    9.  
    10. Private Sub Command1_Click()
    11.     Set hInp = hDoc.getElementById("upc")
    12.     hInp.focus
    13.     hInp.Value = "07800008846"
    14.     SendKeys "{ENTER}", True
    15. End Sub
    16.  
    17. Private Sub Form_Load()
    18.     WebBrowser1.Navigate2 "http://www.upcdatabase.com/nocheckdigit.pl"
    19. End Sub
    20.  
    21. Private Sub Form_Resize()
    22.     If Me.WindowState <> vbMinimized Then
    23.         WebBrowser1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight - 450 'Make adjustment for command button
    24.     End If
    25. End Sub
    26.  
    27. Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    28.     Set hDoc = WebBrowser1.Document
    29. End Sub
    Attached Images Attached Images  
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  27. #27
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    Have you done any work on extracting the resulting data? If so can you post it. I dont mind helping but I
    really dont have enough time to write it all.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  28. #28
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    To answer your question, you can code it similar to the way you can write html and javascript.
    We wait for the data page to return and load. Then we can access the elements and read the values for
    each of the elements you need.

    Are you familar with HTML and JavaScript?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  29. #29

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: I need to get data form a web page

    no!!
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  30. #30
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    Ok, let me see if I can do a little more for you, but you should try to pick some of this up as HTML and JS
    are common skills among programmers.

    It will come in handy for you .
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  31. #31
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    Did you need to save the UPC image too?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  32. #32
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    Ok, here is is. All you have to do is add code to read in your upc numbers to evaluate and write the values
    I already parsed out for you to a file and its complete.

    Oh ya, if you want to save the barcode picture, just parse out the location and set it as the source for a Inet
    Transfer control. Then write it to an image file.

    VB Code:
    1. Option Explicit
    2. 'Add a reference to Microsoft HTML Object Library
    3. 'Add component Microsoft Internet Controls
    4.  
    5. 'Add a command button (Command1)
    6. 'Add a web browser control to the form (WebBrowser1)
    7. Dim hDoc As MSHTML.HTMLDocument
    8. Dim hCol As MSHTML.IHTMLElementCollection
    9. Dim hInp As MSHTML.HTMLInputElement
    10. Dim hSub As MSHTML.HTMLInputButtonElement
    11. Dim hTxt As MSHTML.HTMLInputTextElement
    12.  
    13. Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
    14.  
    15. Private Sub Command1_Click()
    16.     Dim iStart As Integer
    17.     Dim iEnd As Integer
    18.     iStart = 0
    19.     iEnd = 0
    20.     If WebBrowser1.LocationURL <> "http://www.upcdatabase.com/nocheckdigit.pl" Then
    21.         WebBrowser1.Navigate2 "http://www.upcdatabase.com/nocheckdigit.pl"
    22.     End If
    23.     Do While WebBrowser1.Busy = True
    24.         DoEvents
    25.         Sleep 500
    26.     Loop
    27.     Set hDoc = WebBrowser1.Document
    28.     Set hInp = hDoc.getElementById("upc")
    29.     hInp.focus
    30.     hInp.Value = "07800008846"
    31.     SendKeys "{ENTER}", True
    32.     Do While WebBrowser1.Busy = True
    33.         DoEvents
    34.         Sleep 500
    35.     Loop
    36.     Set hInp = Nothing
    37.     'Parse the elements and read the values of the data returned
    38.     'Set document variable = to the new results documents page
    39.     Set hDoc = WebBrowser1.Document
    40.     'Find the description:
    41.     iStart = InStr(1, hDoc.body.innerHTML, "<TD>Description</TD>") + 37
    42.     iEnd = InStr(iStart, hDoc.body.innerHTML, "</TD></TR>")
    43.     MsgBox Mid$(hDoc.body.innerHTML, iStart, iEnd - iStart)
    44.     'Find the Size/Weight:
    45.     iStart = InStr(iStart, hDoc.body.innerHTML, "<TD>Size/Weight</TD>") + 37
    46.     iEnd = InStr(iStart, hDoc.body.innerHTML, "</TD></TR>")
    47.     MsgBox Mid$(hDoc.body.innerHTML, iStart, iEnd - iStart)
    48.     'Find Manufacturer:
    49.     iStart = InStr(iStart, hDoc.body.innerHTML, "<TD>Manufacturer</TD>") + 38
    50.     iEnd = InStr(iStart, hDoc.body.innerHTML, "(<A href=")
    51.     MsgBox Mid$(hDoc.body.innerHTML, iStart, iEnd - iStart)
    52.     'Find the Entered/Modified:
    53.     iStart = InStr(iStart, hDoc.body.innerHTML, "<TD>Entered/Modified</TD>") + 42
    54.     iEnd = InStr(iStart, hDoc.body.innerHTML, "</TD></TR>")
    55.     MsgBox Mid$(hDoc.body.innerHTML, iStart, iEnd - iStart)
    56. End Sub
    57.  
    58. Private Sub Form_Load()
    59.     WebBrowser1.Navigate2 "http://www.upcdatabase.com/nocheckdigit.pl"
    60. End Sub
    61.  
    62. Private Sub Form_Resize()
    63.     If Me.WindowState <> vbMinimized Then
    64.         WebBrowser1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight - 450 'Make adjustment for command button
    65.     End If
    66. End Sub
    67.  
    68. Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    69. '    Set hDoc = WebBrowser1.Document
    70. End Sub
    Last edited by RobDog888; Mar 23rd, 2005 at 03:32 PM.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  33. #33
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: I need to get data form a web page

    I tried to run this, but can't find the MSHTML control. I thought I did things correctly. Any clues?

  34. #34
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    Did you add both controls to your toolbox/form?
    VB Code:
    1. 'Add component Microsoft HTML Object Library
    2. 'Add component Microsoft Internet Controls
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  35. #35
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: I need to get data form a web page

    Considering they're right next to each other in components, it wasn't hard.
    One is called Scriptlets1, though.

  36. #36
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    I just connect to my home system and pulled up the project. It should be one control and one reference:
    VB Code:
    1. 'Add reference to Microsoft HTML Object Library
    2. 'Add component Microsoft Internet Controls
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  37. #37
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: I need to get data form a web page

    Hmm. It worked when I used two referenced instead of two components.
    Thanks. On to then second one.

  38. #38
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    But if you dont use "Microsoft Internet Controls" control then you cant get a webbrowser on your form?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  39. #39
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: I need to get data form a web page

    I have Internet Control Reference, so it works.

    That is my first experience with the HTML Object library. I knew that there had to be more to parsing than what I've seen.

    Thanks. I'll try to adapt this to other uses.
    Last edited by dglienna; Mar 23rd, 2005 at 04:51 PM.

  40. #40
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I need to get data form a web page

    Yes, this was my first time using both the HTML Object library and the Web browser object.
    Quite cool to be able to automate a web page using both techniques!
    I knew that there had to be more to parsing than what I've seen.
    This is all the code there was that I posted, unless you mean that you havent seen the way I get
    the elements for population before.

    Either way, its added to your archives of examples.

    Glad you got it working, but where is Bob?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Page 1 of 3 123 LastLast

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