tags:

views:

172

answers:

1

In C#, how can I extract the URL's of any images found when performing a search with Google? I'm writing a little app to get the artwork for my ripped cd's. I played around with the Amazon service but found the results I received were erratic. I can't be bothered to learn the whole Amazon API just for this simple little app though, so thought I'd try Google instead.

So far, I've performed the search and got the result page's source, but I'm not sure how to extract the URL's from it. I know I have to use Regex but have no idea what expression to use. All the one's I've found seem to be broken. Any help would be appreciated.

+1  A: 

Try using the HTML Agility Pack. It works wonders on scraping content.

It lives here on Codeplex.

I used it to scrape a user ranking list from so.com, and loved it.

It will let you select a node of html and then query subnodes using XSLT.

Chris Ballance
That looks perfect mate. I'll give it a try. Thank you.
woodstock
Let me know what you come up with. I would be glad to share my code for the ranking list if you think that might help you out.
Chris Ballance