Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Anyone done any Web Scraping in C++/MFC

Anyone done any Web Scraping in C++/MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bryan Anslow
    wrote on last edited by
    #1

    Hi, I currently get data from a website like this; Go to the webpage, wait while the page loads, "select" the data in the webpage by dragging my mouse over it, Copy to clipboard, call up my text editor, Paste the data into the editor, save the output, analyze the data using my C++/MFC Analyzer. There must be a way I can get the data without the need to copy/paste etc. I know something about HTTP Connections, sockets, etc., but I am at a loss to know just what parameters need to be passed to the website in the request. I tried just sending the URL of the webpage, which returned a lot of stuff which I did not want. Does anyone have a simple example of how this is supposed to work? Thanks so much, Bryan.

    L D 2 Replies Last reply
    0
    • B Bryan Anslow

      Hi, I currently get data from a website like this; Go to the webpage, wait while the page loads, "select" the data in the webpage by dragging my mouse over it, Copy to clipboard, call up my text editor, Paste the data into the editor, save the output, analyze the data using my C++/MFC Analyzer. There must be a way I can get the data without the need to copy/paste etc. I know something about HTTP Connections, sockets, etc., but I am at a loss to know just what parameters need to be passed to the website in the request. I tried just sending the URL of the webpage, which returned a lot of stuff which I did not want. Does anyone have a simple example of how this is supposed to work? Thanks so much, Bryan.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      If you read the HTML output directly then there will be a load of stuff that you are perhaps not interested in. The answer is to find some classes that help you find specific parts quickly, and C++/MFC does not offer the facilities that are available in .NET. Most web scrapers are written in the latter framework using C# or VB.NET. As to what information to send to the website, that depends on the website itself as each one has its own structure.

      1 Reply Last reply
      0
      • B Bryan Anslow

        Hi, I currently get data from a website like this; Go to the webpage, wait while the page loads, "select" the data in the webpage by dragging my mouse over it, Copy to clipboard, call up my text editor, Paste the data into the editor, save the output, analyze the data using my C++/MFC Analyzer. There must be a way I can get the data without the need to copy/paste etc. I know something about HTTP Connections, sockets, etc., but I am at a loss to know just what parameters need to be passed to the website in the request. I tried just sending the URL of the webpage, which returned a lot of stuff which I did not want. Does anyone have a simple example of how this is supposed to work? Thanks so much, Bryan.

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Bryan Anslow wrote:

        Go to the webpage, wait while the page loads, "select" the data in the webpage by dragging my mouse over it, Copy to clipboard, call up my text editor, Paste the data into the editor, save the output, analyze the data using my C++/MFC Analyzer.

        I think you can replace all but the last of these steps with URLDownloadToFile().

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        B 1 Reply Last reply
        0
        • D David Crow

          Bryan Anslow wrote:

          Go to the webpage, wait while the page loads, "select" the data in the webpage by dragging my mouse over it, Copy to clipboard, call up my text editor, Paste the data into the editor, save the output, analyze the data using my C++/MFC Analyzer.

          I think you can replace all but the last of these steps with URLDownloadToFile().

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

          B Offline
          B Offline
          Bryan Anslow
          wrote on last edited by
          #4

          Hey, that works well, thanks for pointing me at that function. My minor hurdle right now is that I need to login with my userid and password to access one of the pages. Don't suppose that there is some way of getting my credentials in there somehow? Thanks, Bryan.

          D 1 Reply Last reply
          0
          • B Bryan Anslow

            Hey, that works well, thanks for pointing me at that function. My minor hurdle right now is that I need to login with my userid and password to access one of the pages. Don't suppose that there is some way of getting my credentials in there somehow? Thanks, Bryan.

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            See if NetUseAdd() helps.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups