Lately, I have been given the task of stealin data from the job sites like Yahoo, CarrerBuilder and Monster and others like Bigwheels & StylineConcepts. I m really pissed off by doing this job since the last 1 month or so. As soon as I finish off with the parsing of 1 site. Another site comes for the parsing. I m waiting for a new project which doesnt involve html parsing.
This is the function which i used to extract the html content of a page into the string and used it further as i required.
public string Find_Source_Code(string myURL)
  {
   if(myURL.Trim().Length<=0) return "";
   
   string return_result = "";
   System.Net.WebClient Http = new System.Net.WebClient();
   WebRequest objRequest = System.Net.HttpWebRequest.Create(myURL);
   
   try
   {
    using(StreamReader sr =  new StreamReader(objRequest.GetResponse().GetResponseStream()))
    {
     return_result = sr.ReadToEnd();
     sr.Close();
    }
   }
   catch
   {
    return_result = "";
   }  
   return return_result;
  }
private void ParsenCheck()
  {
   string line=Find_Source_Code(url);
   string[] Description;
   Boolean flag;
   flag=false;
   
   Description=line.Split('\n');
   //Some more string commands to parse the data    
  }
 
2 comments:
Really amazing! Useful information. All the best.
»
Really amazing! Useful information. All the best.
»
Post a Comment