Find the answer to your Linux question:
Results 1 to 7 of 7
hi all how to read data( means which is opening in the page ) of the web page using "c". please help me thank you in advance...
  1. #1
    Linux Newbie
    Join Date
    Feb 2007
    Location
    hyderabad, india
    Posts
    247

    read data from webpage

    hi all
    how to read data( means which is opening in the page ) of the web page using "c".

    please help me

    thank you in advance
    "Relationships are built on trust and communication"

  2. #2
    Just Joined!
    Join Date
    Oct 2007
    Posts
    22
    You're going to have to give me more than that to go on. Do you know how to program in C? If so, are you familiar with communicating with a network in C?

    If you answered no to either of those questions, I fear you are in over your head until you expand your education in C.

  3. #3
    Linux Newbie
    Join Date
    Feb 2007
    Location
    hyderabad, india
    Posts
    247
    yes i tried this but not getting total page in one array
    Code:
    ARRAY=( $(lynx -dump Google) )
    echo $ARRAY
    but it is printing only this text
    Quote:
    [1]iGoogle
    what i have to do to store the total data in to the string.

    please help me

    thank you in advance
    "Relationships are built on trust and communication"

  4. #4
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    munna_dude, it took me a while to figure out what you meant by this question. Then it occurred to me that this question might be related to the one you posed in this thread.

    So combining the two questions, you can write a bash script to restrict the web page output to the data that is after a line containing "Underlying Value" but before a line containing "Top" thus:

    Code:
    lynx -dump "http://whatever.com/pagename.html" | sed -e '1,/Underlying Value/d' | sed -e '/Top/,$d'
    But you say you want to do this in C. How much of this do you want to do in C?

    The quickest and dirtiest way is to combine the above command into a system() function call.

    The slowest, most painful way is to do all the network programming and string recognition yourself.

    Where would you like to go from here?

  5. #5
    Linux Newbie
    Join Date
    Feb 2007
    Location
    hyderabad, india
    Posts
    247
    Quote Originally Posted by wje_lf View Post
    The quickest and dirtiest way is to combine the above command into a system() function call.

    The slowest, most painful way is to do all the network programming and string recognition yourself.

    Where would you like to go from here?
    is it possible to write the program in c..
    "Relationships are built on trust and communication"

  6. #6
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Smile

    Quote Originally Posted by munna_dude View Post
    is it possible to write the program in c..
    Yes.You can call system() in C program with appropriate command.
    Ex:
    Code:
    main(){
    system("ls -l");
    }
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  7. #7
    Just Joined!
    Join Date
    Oct 2007
    Posts
    22
    Anything is possible in C. :P except maybe fault tolerence.

Posting Permissions

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