![]() |
|
#1
|
|||
|
|||
Parsing to HTML document in C++.Hi all.
I need to do parsing to HTML document in C++. Goal is to take HTML file as input and return as output separated text of links, titles and body. Can somebody tell me how to do it? |
|||
|
#2
|
||||
|
||||
|
parsing an html file is like parsing any text file. You just need to go through and look for the proper keywords and then extract the information after it. I have written a couple of small functions that I can post if you would like. They don't do exactly what you are afte r, but they extract needed information from an HTML file.
|
|
#3
|
||||
|
||||
|
Hello dsmith,
Please go ahead.. post your functions if you like. Many readers find this page off the search engines and may find any information you can share useful. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#4
|
||||
|
||||
|
Okay, here a few basic functions. They are kind of hacked but they work. I wrote them for a office football pick pool tracking program. I used them to automatically extract the games and spreads each week. They worked for my specific purpose, but obviously need some work depending upon your application
CPP / C++ / C Code:
So, to parse a page for links, you could use something like: CPP / C++ / C Code:
I didn't test that, but it should go threw an html file that is opened with fopen and store all of the html link locations and associated key words. If these are of any use, feel free to use them. They obviously come with no garantee that they won't burn down your house or kill your dog... |
|
#5
|
||||
|
||||
|
Thank you... I have just edited the bbcode you used in your post so that they are immediately obvious for what they are.
Instead of using [code] to surround your C/C++ code examples, you can use [c++] or even simply [c]. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#6
|
||||
|
||||
|
JdS:
Thanks, that bbcoding sure makes a difference. I have used editors that don't have that nice of syntax highlighting ![]() |
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DiscountASP.NET Launches FREE RichTextBox ASP.NET HTML Editor | dasp | Web Hosting Advertisements & Offers | 2 | 24-Sep-2008 14:11 |
| Parsing PHP code that's stored in a database. | JdS | MySQL / PHP Forum | 3 | 13-May-2004 10:15 |
| JavaScript Tutorial Part 1 | pcxgamer | Web Design Forum | 2 | 01-Dec-2003 10:16 |
| html to php | tenaki | Web Design Forum | 17 | 28-Oct-2003 17:18 |
| [class] Generate Forms Without Using HTML! | Elmseeker | PHP Code Library | 6 | 11-Mar-2003 13:05 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The