Jump to content

C# and websites

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Siten0308

Siten0308

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 302 posts
Hello,

I am planning on creating a application that will sorta interact with websites, i am also planning on creating the GUI interface using WPF, with C# in the background, my question is, can you use listview or listbox or anything and have it interact with websites, such as one of the things i want it to do is, a user types in the textbox lets say... library, then the application looks on google search engine to find all the websites that says library on the blue link to the website and/or also in the small description, and pull those websites to a listbox/listview or any other object capable of doing it including able to click on the link to take you to the website etc? this may be a stupid question but just wondering.

Thank you
Its only funny till someone gets hurt.... THEN ITS HILARIOUS :)

#2
charless

charless

    Newbie

  • Members
  • PipPip
  • 14 posts
All thats fairly simple (in theory).
Using the System.Net classes you can download a webpage (dynamic or static) such as a good search.
Then its as simple (ha) as parsing the file to extract the information you need.
For the google search idea all you'd have to do is:
-Construct your search url like this: GOOGLEURL/search?q=<SEARCH QUERY>
-Download the webpage somehow, most likely using System.Net's webclient
-Use some sort of html parser to extract the webpages you need.
-Display them in a listbox/or w/e

The hardest(and slowest) part would be the parsing of the HTML

Intereacting with webpages via System.Net's webclient is easy, but unless the data recieved is designed to interact with your application, it will most likely be a tough battle to extract the data you need.

Hope that helps.

I had a good webpage that may have helped but the forum wont let me post links untill I have 10 posts :(

#3
Siten0308

Siten0308

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 302 posts
thanks charles for your reply,

for the extraction part, i would not neet, the only thing i would say is making sure there are words that match the description etc. of the words searched or want to be searched in a textbox typed by the user, the search will bring up the website so the user can click on the link to go to that website, i assume there is a object for that but forgot what its called. thanks, any other input or ideas would be helpful if anyone wants to add..

PS charles... uhh.. do you know your on fire?? : \ ??
Its only funny till someone gets hurt.... THEN ITS HILARIOUS :)