Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0
please help
 
how to extract data with c#
 
how to extract first 10 page results from below website
 
http://www.gutefrage.net/suche?q=fenster&ie=UTF-8
 
thank you
Posted 30-Oct-12 6:11am
Comments
ryanb31 at 30-Oct-12 13:26pm
   
Start with something like
 
string downloadedString;
System.Net.WebClient client;
 
client = new System.Net.WebClient();
 
downloadedString = client.DownloadString("http://yoursite");
Sergey Alexandrovich Kryukov at 30-Oct-12 15:42pm
   
Yes, this in some simplest cases. In more complex cases, HttpWebRequest is needed; and also some way to parse the HTML and drill it in.
I provided some more detailed answer, please see.
--SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

What you need is called web scraping:
http://en.wikipedia.org/wiki/Web_scraping[^].
 
You need to use either System.Net.WebClient (for simplest cases) or System.Net.HttpWebRequest with System.Net.WebResponse, in a general case. Please see:
http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx[^],
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx[^],
http://msdn.microsoft.com/en-us/library/system.net.webresponse.aspx[^].
 
For a simple code sample, please see:
http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx[^].
 
See also my past answers to related questions:
How to get the data from another site[^],
get specific data from web page[^].
 
—SA
  Permalink  
Comments
Maciej Los at 30-Oct-12 16:47pm
   
Short and to the point, my 5!
 
I didn't knew it ;)
Sergey Alexandrovich Kryukov at 30-Oct-12 18:37pm
   
Thank you, Maciej.
And now you know it! :-)
--SA
Member 9004602 at 30-Oct-12 19:58pm
   
dear sir
my requirement is
how to automate or click pages links 1, 2, 3, ........ 10
and get required data from above website
thank you
Member 9004602 at 30-Oct-12 20:02pm
   
dear sir
 
i try with downloadstring method and write to text file.
but i don't find required data (all search urls from page).
how to automate or click 1,2,3, ...... 10 pages links and extract required data.
 
thank you
Sergey Alexandrovich Kryukov at 30-Oct-12 20:31pm
   
Well, this is the detail of how the page is organized. You will need to research it, perhaps starting with manual loading and lookup. They you will need to parse it. I've recommended the HTML parser, please see my links. And then, devise some mapping which will get you your links which you will download in the same way. You got all what's involved, now you need to actually do the job.
If you finally see how it makes sense, please accept the answer formally (green button) -- thanks.
--SA
Sushil Mate at 30-Oct-12 23:44pm
   
web scraping?? even i didn't knew.. thanks for sharing :) +5
Sergey Alexandrovich Kryukov at 31-Oct-12 1:19am
   
You are very welcome -- and thanks.
--SA

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

  Print Answers RSS
0 OriginalGriff 365
1 Sergey Alexandrovich Kryukov 319
2 CPallini 275
3 DamithSL 214
4 Maciej Los 185
0 OriginalGriff 5,455
1 DamithSL 4,457
2 Maciej Los 3,885
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,115


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 30 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100