Thread: input data from a website.

  1. #1
    Registered Abuser Loic's Avatar
    Join Date
    Mar 2007
    Location
    Sydney
    Posts
    115

    input data from a website.

    Hi all,

    I am trying to write a program that will extract data from a web site. And out put it to a file, previously I have used piping to input/output data, but I though it was time I learnt another method, with to me seems much more effective. But where I have hit a brick wall is that I want it to loop and every time I want it to increment the url by 1. I had a stab in the dark as how to do it, but it wont work. Any one able to tell me where I am going wrong?
    sorry if i am not that clear, but hopefully the code i have posted below clears every thing up.
    Code:
    #include <iostream>
    #include <fstream>
    using namespace std;
    
    int main ()
    {
        ofstream siteHTML;
        for (int i=0; i<100; i++)
        {
            siteHTML.open("http://website.com/page.php?u="i, iso::in);
        }
        return 0;
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Which OS/Compiler?

    For Linux (or indeed windows), look at http://curl.haxx.se/

    For Windows only, search the windows board as this was discussed pretty recently.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 48
    Last Post: 09-26-2008, 03:45 AM
  2. data structure design for data aggregation
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 05-20-2008, 06:43 AM
  3. Sorting data retrieved from input file
    By Minds_I in forum C Programming
    Replies: 3
    Last Post: 07-20-2003, 06:25 PM
  4. Replies: 2
    Last Post: 05-12-2003, 04:40 PM
  5. reading a columns input data file
    By vk13wp in forum C Programming
    Replies: 6
    Last Post: 04-28-2003, 01:32 PM