• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple text from Google search results  RSS feed

 
Kovacs Akos
Ranch Hand
Posts: 87
1
Firefox Browser Netbeans IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I would like to filter simple text from search result lists in Google. I would like to get only short description of each result, but I do not know, what should be the right regex for this purpose.

This code can filter URLs:


Example whole result:

Web search query - Wikipedia, the free encyclopedia en.wikipedia.org/wiki/Web_search_query A web search query is a query that a user enters into a web search engine to satisfy his or her information needs. Web search queries are distinctive in that they ... ‎Types - ‎Characteristics - ‎Structured queries - ‎See also


Needed part:

A web search query is a query that a user enters into a web search engine to satisfy his or her information needs. Web search queries are distinctive in that they


 
Srikkanth Mohanasundaram
Ranch Hand
Posts: 243
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kovacs,

You're basically making some assumptions on how google search results links are going to be like in line 67,68. How can you be sure that google will continue to form URLs like that ?

Have you taken a look at their Custom Search API ?

Thanks
Srikkanth

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!