Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi friends. i want to search for Website or weblogs in internet that have some words on their address. how can i do this in c#.

thanks in advance.
Posted
Updated 19-Jul-14 14:54pm
v2
Comments
[no name] 19-Jul-14 10:55am    
Do it the easy way and use google or bing or the search engine of your choice.
_Starbug_ 19-Jul-14 11:04am    
that is correct.how can i do this programatically
[no name] 19-Jul-14 11:06am    
What do you mean "how"? You write some code, that is how.
_Starbug_ 19-Jul-14 13:22pm    
what class i must use for doing this? what methods?
[no name] 19-Jul-14 14:51pm    
http://www.google.com/search?q=c%23+google+search

1 solution

It depends in the media types of the resource you want to use and even their structures, depending on what exactly do you need. In particular, with HTML pages, you would need to parse them or simply use regular expression search for URLs (http://en.wikipedia.org/wiki/Regular_Expression[^], http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex%28v=vs.110%29.aspx[^]).

Ideally, it would be good if you could parse the HTML documents as XML, but, quite unfortunately, not all HTML documents are authored as well-formed XML, then you would need some HTML parser. See, for example: http://www.majestic12.co.uk/projects/html_parser.php[^].

See also: http://en.wikipedia.org/wiki/Web_scraping[^].

See also my past answers:
get specific data from web page[^],
How to get the data from another site[^].

—SA
 
Share this answer
 
Comments
_Starbug_ 20-Jul-14 14:53pm    
thanks friend.nice ideas.
Sergey Alexandrovich Kryukov 20-Jul-14 21:06pm    
You are welcome. Will you accept the answer formally then (green "Accept" button)?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900