diff --git a/IOB-WIN/DATA/CONF/MAIN.ini b/IOB-WIN/DATA/CONF/MAIN.ini index 9c82e2e6..ecbfe56b 100644 --- a/IOB-WIN/DATA/CONF/MAIN.ini +++ b/IOB-WIN/DATA/CONF/MAIN.ini @@ -11,7 +11,7 @@ CMDIOB2CALL=/IOB/getIob2call?GWIP= [IOB] ;--- TEST SIMULAZIONE -STARTLIST=3017 +STARTLIST=3018 ;STARTLIST=SIMUL_01 ;STARTLIST=3015 diff --git a/IOB-WIN/IOB-WIN.csproj b/IOB-WIN/IOB-WIN.csproj index 54ce443a..adfd0306 100644 --- a/IOB-WIN/IOB-WIN.csproj +++ b/IOB-WIN/IOB-WIN.csproj @@ -107,6 +107,9 @@ + + ..\packages\Selenium.WebDriver.3.141.0\lib\net40\WebDriver.dll + diff --git a/IOB-WIN/IobWPS.cs b/IOB-WIN/IobWPS.cs index b32ff10f..60fd4f42 100644 --- a/IOB-WIN/IobWPS.cs +++ b/IOB-WIN/IobWPS.cs @@ -4,6 +4,8 @@ using System; using System.Collections.Generic; using System.Linq; using System.Net.NetworkInformation; +using OpenQA.Selenium; +using OpenQA.Selenium.Firefox; namespace IOB_WIN { @@ -71,6 +73,7 @@ namespace IOB_WIN doc.Load(sr); #endif +#if false // faccio download preliminare pagina NON LEGGE var web = new HtmlWeb(); var htmlDoc = web.Load(baseUri); @@ -84,7 +87,26 @@ namespace IOB_WIN lgInfo("FULL TEXT"); lgInfo("--------------------------------------"); lgInfo(htmlDoc.Text); - lgInfo("--------------------------------------"); + lgInfo("--------------------------------------"); +#endif + + // https://www.youtube.com/watch?v=7iCUzKFDuXM + // https://stackoverflow.com/questions/39668501/c-sharp-selenium-how-to-execute-javascript-on-web-driver-while-page-is-still-lo + // http://scraping.pro/example-of-scraping-with-selenium-webdriver-in-csharp/ + // https://html-agility-pack.net/knowledge-base/23033578/how-do-i-screen-scrap-html-page-generated-by-javascript + // https://stackoverflow.com/questions/24130650/scraping-data-dynamically-generated-by-javascript-in-html-document-using-c-sharp + // https://www.nuget.org/packages/ScrapySharp/ + // https://github.com/rflechner/ScrapySharp + + + var driver = new FirefoxDriver(); + driver.Navigate().GoToUrl("http://www.google.com"); + + IJavaScriptExecutor js = driver as IJavaScriptExecutor; + + string title = (string)js.ExecuteScript("return document.title"); + + lgInfo(title); } catch (Exception exc) diff --git a/IOB-WIN/packages.config b/IOB-WIN/packages.config index 37104f6b..3f5f0351 100644 --- a/IOB-WIN/packages.config +++ b/IOB-WIN/packages.config @@ -7,4 +7,5 @@ + \ No newline at end of file