TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mead Alsorani
NA
10
564
Hanging HtmlAgilityPack Task
Jan 1 2020 10:03 AM
I am trying to parse an html page with HtmlAgilityPack to Extract links from it then add links to ListBox then add the links from listBox to queue.
I have three Tasks(PageParse,AddItemsToList,EnqueueFromList)
OK My problem is when I click the button the whole Application is hanging.
button Code
private
void
CrawdBtn_Click(
object
sender, EventArgs e)
{
t = Task.Factory.StartNew(PageParse);
t.Wait();
TaskAddToList = Task.Factory.StartNew(() => AddItemsToList(t.Result));
TaskAddToList.Wait();
b =
new
Task(EnqueueFromList);
b.Start();
//Task.WaitAll(t,b);
CrawdBtn.Enabled =
true
;
}
Page Parse Method
public
HtmlAgilityPack.HtmlDocument PageParse()
{
MessageBox.Show($
"Page Parse Has started"
);
web =
new
HtmlWeb();
doc =
new
HtmlAgilityPack.HtmlDocument();
doc = web.Load(UrlText.Text);
return
doc;
}
I have Noticed by following breakpoints That the debugger is hanging when it goes to execute PageParse Method
Reply
Answers (
0
)
Shared control inside listview wpf
how to stop client exe from server exe