Search Urban Dictionary with C#

January 22, 2010 by Dave
 

Here’s a quick example of how one might scrape the search results from Urban Dictionary.  This shows some nice use of Regular Expressions and WebClient.

(View Text)

Thankfully Urban Dictionary is a very scrape-friendly site, finding results is as easy as locating two div’s and extracting the contents.

UrbanDictionary.Search(string); will return a list of key-value pairs which contain the word as the key, and the Urban Dictionary definition as the value.

Comments