[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 182
  • Last Modified:

Searching html files

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
ee96m17
Asked:
ee96m17
1 Solution
 
icdCommented:
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now