Thread: Extracting strings from HTML tags!

  1. #1
    Registered User
    Join Date
    Oct 2011

    Extracting strings from HTML tags!


    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
    Join Date
    Aug 2010
    Ontario Canada
    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, 03:58 AM
  2. How to extract variables from between html tags?
    By purpleturple in forum C++ Programming
    Replies: 11
    Last Post: 10-02-2009, 09:38 PM
  3. HTML tags validator
    By Terrorist in forum C Programming
    Replies: 24
    Last Post: 05-09-2008, 02: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
    Replies: 4
    Last Post: 03-27-2002, 07:52 AM