diff --git a/PaheScrapper/Helpers/WebErrorReporter.cs b/PaheScrapper/Helpers/WebErrorReporter.cs index 46d2578..f9de44f 100644 --- a/PaheScrapper/Helpers/WebErrorReporter.cs +++ b/PaheScrapper/Helpers/WebErrorReporter.cs @@ -6,9 +6,9 @@ namespace PaheScrapper.Helpers { public static class WebErrorReporter { - public static void HttpError(WebResponse webResponse) + public static void WebException(WebException webException) { - LogWriter lw = new LogWriter("Http Dump: \n" + JsonConvert.SerializeObject(webResponse)); + LogWriter lw = new LogWriter("Web Exception Dump: \n" + JsonConvert.SerializeObject(webException)); } public static void HtmlError(HtmlDocument htmlDocument) diff --git a/PaheScrapper/Program.cs b/PaheScrapper/Program.cs index 9651ace..94c6ce1 100644 --- a/PaheScrapper/Program.cs +++ b/PaheScrapper/Program.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Linq; +using System.Net; using System.Runtime.InteropServices; using PaheScrapper.Helpers; using PaheScrapper.Properties; @@ -19,6 +20,10 @@ static void Main(string[] args) ScrapperWeb.ReleaseGarbageScrape(); + /*Fix SSL/TLS Problem*/ + ServicePointManager.Expect100Continue = true; + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; + if (args.Length == 0) FullScrape(); else diff --git a/PaheScrapper/ScrapperWeb.cs b/PaheScrapper/ScrapperWeb.cs index 576511f..4e9c44c 100644 --- a/PaheScrapper/ScrapperWeb.cs +++ b/PaheScrapper/ScrapperWeb.cs @@ -39,7 +39,7 @@ public static HtmlDocument GetDownloadHtml(string url, WebRequestHeader header) } catch (WebException e) { - WebErrorReporter.HttpError(e.Response); + WebErrorReporter.WebException(e); throw new ScrapperDownloaderException("Cannot Get Response.", e); } @@ -96,7 +96,7 @@ public static HtmlDocument PostDownloadHtml(string url, Dictionary