Solved

Searching html files

Posted on 1997-07-12
1
145 Views
Last Modified: 2013-12-25
I'm trying to write a search engine in 'C'for several www pages. The idea i that the search engine will search through these pages and record the number of times the required word is found. It should also return the URL of the pages where the word was found. I've written an html form asking for the search word, but I'm not having much luck opening the required html files and searchig through them. I dont really know the best way to search through html files.  Can anyone please help ?  I originally posted this question on the C pogrammers questions, but was advised to try here instead.
               Phil H.
0
Comment
Question by:ee96m17
1 Comment
 
LVL 5

Accepted Solution

by:
icd earned 200 total points
ID: 1829037
I assume you are able to run cgi scripts on your server (always worth asking).

You can find several search engine scripts in C at the following URL.

http://www.cgi-resources.com/

Follow the links to 'scripts' 'C' and then Search Engines.

Don't discount scripts written in other languages (such as perl)

One further point I would make. You have two options. The first one is that the search takes place at the point the user submits the form. This is OK if there are a small number of pages that are updated frequently.

The second options is probably the most effective, you do the same as the big Internet search engines do. You have an independent process that periodically scans all your pages and compiles a database of key words. When the user submits the search form then you can go straight to the database to find the key words. This is *far* more efficient when the documents don't change very frequently compared to the number of search requests.

I think you will find scripts for both these approaches on the resourse I gave above.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now