1

When included in my code

ScrapingBrowser browser = new ScrapingBrowser();

WebPage testPage = browser.NavigateToPage(new Uri("https://www.google.co.uk/"));

causes the Windows Form to stop working (once this line is reached in execution, the form freezes and I have to halt execution). However, there are no errors or anything else to indicate something is wrong.

nvoigt
  • 75,013
  • 26
  • 93
  • 142
KangarooChief
  • 381
  • 3
  • 14

2 Answers2

1

You should not use this method from your UI thread. Use your favorite technology (BackgroundWorker, Task, Thread) to run this on another thread that does not block the UI thread.

You could also use ScrapySharp's own async method: NavigateToPageAsync

nvoigt
  • 75,013
  • 26
  • 93
  • 142
0

Seems that ScrappySharp doesn't work in Windows Forms. I've used the same Form code in a Console project and it works perfectly.

Disu
  • 113
  • 10
  • Your answer doesn't solve the problem...i would put it as a comment not as an answer – J.J Aug 07 '20 at 17:47