Extracting strings from HTML tags!

This is a discussion on Extracting strings from HTML tags! within the C Programming forums, part of the General Programming Boards category; Hey, I'm fairly new to C programming and I'm trying to extract strings from within HTML tags! For instance, if ...

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    1

    Extracting strings from HTML tags!

    Hey,

    I'm fairly new to C programming and I'm trying to extract strings from within HTML tags!
    For instance, if i have the following.

    li class="toclevel-1 tocsection-1"><a href="#Combinatorial_algorithms"><span class="tocnumber">1</span> <span class="toctext">Combinatorial algorithms</span></a>

    I want to extract the string "#Combinational_algorithms"

    I tried using various methods in the strtok() function but dint succeed!

    Can anyone please let me know, how i can do this??

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Use strstr() to find "#" then a loop to copy until the next " or > is found.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Adding HTML tags
    By zacs7 in forum C++ Programming
    Replies: 1
    Last Post: 08-25-2010, 04:58 AM
  2. How to extract variables from between html tags?
    By purpleturple in forum C++ Programming
    Replies: 11
    Last Post: 10-02-2009, 10:38 PM
  3. HTML tags validator
    By Terrorist in forum C Programming
    Replies: 24
    Last Post: 05-09-2008, 03:14 AM
  4. Help w/ HTML Tags
    By Landroid in forum C++ Programming
    Replies: 5
    Last Post: 03-08-2005, 08:19 PM
  5. HTML tags
    By netboy in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 03-27-2002, 07:52 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21