douciping4283 2015-10-02 18:46
浏览 18
已采纳

创建用于查找和匹配用户输入的网页抓取工具[关闭]

I made a website with many pages, on each page is a sample essay. The homepage is a page with a search field. I'm attempting to design a system where a user can type in a word and when they click 'search', multiple paragaphs containing the searched word from the pages with a sample essays are loaded on to the page.

I'm 14 and have been programming for about 2 years, can anyone please explain to me the programming languages/technologies I'll need to accomplish this task and provide suggestions as to how I can achieve my task.

All I have so far are the web pages with articles and a custom search page I've made with PHP. Any suggestions?

  • 写回答

1条回答 默认 最新

  • dongping4901 2015-10-02 20:34
    关注

    The programing language does not realy matter for the way to solve the problem. You can implement it in the language which you are comfortable with.

    There are two basic ways to solve the problem:

    1. Use a crawler which creates a index of words found on the different pages The use that index to lookup the searched word

    or

    1. When the user has entered the search expression, you start crawling the pages and look if the search expression is found

    Of course both solutions will have different (dis)advantages

    For example: In 1) you need to do a inital crawl (and udate it later on when the pages change)

    In 1) you need to store the crawl result in some sort of database

    In 1) you will receive instanst search results

    In 2) You don't need a database/datastore

    In 2) You will have to wait until all pages are searched before showing the final resultlist

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog