برنامه خزنده های تحت وب با Asp.net
راستش من میخام همچین کاری انجام بدم . اما نمی دونم از کجا شروع کنم ؟!! ایا با asp.net میشه اصلا اینکارو کرد یا نه ؟ تو php فکر کنم curl کمک انجام اینکار باشه اما تو asp چه شکلی هست ایا قبلا کسی اینکار رو انجام داده ؟ از دوستان تقاضا میشه در صورت دونستن انجام اینکار اطلاعاتشونو از ما دریغ نکنن. (متشکرم)
نقل قول: برنامه خزنده های تحت وب با Asp.net
اگر منظورتون از برنامههای خزنده برنامههایی مثل Crawlerهای موتورهای جستجو باشه باید بگم شدنش میشه اما برای نوشتن این برنامه از ویژگیهای اختصاصی ASP.net استفاده نمیکنید. به یه برنامه نیاز دارید که صفحات وب رو بگیره، لینکها رو در بیاره و بعد صفحات هر لینک رو دریافت کنه. برای این کار از یک برنامه کنسول یا Windows Application ساده هم میتونید استفاده کنید که همخوانی بیشتری با این نوع برنامه دارند. اطلاعاتی که برنامه Crawler بدست میاره رو میتونید در یه دیتا بیس قرار بدید و یه برنامه ASP.net داشته باشید که از اون دیتا بیس بخونه و سرویس بده.
لینکهای زیر مثالهایی از این کار هست که لینک دانلود پروژهها رو هم در آخر متن گذاشتند:
http://www.developerfusion.com/article/84330/building-a-web-crawler/
http://www.thecodinghumanist.com/Con...rInCSharp.aspx
لینکها و محتوای این صفحه هم ممکنه به دردتون بخوره:
http://stackoverflow.com/questions/4...rst-webcrawler
1 ضمیمه
نقل قول: برنامه خزنده های تحت وب با Asp.net
ممنون بابت کمکتون. ضمیمه 88251
یکی از برنامه ها مورد داره به اسم crawler
منظور از این ارور چیه و چه جوری حل میشه؟
نقل قول: برنامه خزنده های تحت وب با Asp.net
Error: Unable to connect to the remote server
نقل قول: برنامه خزنده های تحت وب با Asp.net
ببینید دقیقا کاری که میخاد انجام بگیره اینه که ما یه برنامه داشته باشیم که بهش یه آدرسی رو بدهیم و سپس اون لینک هایی رو تحویل ما بده که مربوط به اون نوشته باشه. هدف اینه . موارد مورد نیاز و اسه انجام این کار چیه . نمونه برنامه مثل این مورد رو داریم؟ مثل (؟) . از کجا باید شروع کنم و ...
نقل قول: برنامه خزنده های تحت وب با Asp.net
سلام، من از کد زیر استفاده کردم ولی گاهی که تعداد لینک ها زیاد می شه system timeout می ده. چی کار کنم که اینطوری نشه؟
void
getting(string u)
{
string html = "";
string search = "فلش";
using (WebClient webClient = new WebClient())
{
webClient.Encoding = Encoding.UTF8;
html = webClient.DownloadString(u);
}
MatchCollection matches = Regex.Matches(html,
"href[ ]*=[ ]*['|\"][^\"'\r\n]*['|\"]");
foreach (Match match in matches)
{
try
{
string value = match.Value;
value = Regex.Replace(value,
"(href[ ]*=[ ]*')|(href[ ]*=[ ]*\")", string.Empty);
if (value.EndsWith("\"") || value.EndsWith("'"))
value = value.Remove(value.Length - 1, 1);
if (!Regex.Match(value, @"\((.*)\)").Success)
{
string add = "";
if (value.Contains("http:"))
{
add = value;
}
else
{
add = u + value;
}
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(add);
request.UserAgent =
"A .NET Web Crawler";
WebResponse response = request.GetResponse();
Stream stream = response.GetResponseStream();
StreamReader reader =
new StreamReader(stream);
string htmlText = reader.ReadToEnd();
// Label1.Text += add + "<br/>";
if (htmlText.Contains(search))
{
Label1.Text +=
"<a href=\"" + add + "\">" + value + "</a><br/>";
}
}
else
{
// Label1.Text += "nop";
}
}
catch { }
}
}