Appunti x selenium
This commit is contained in:
@@ -11,7 +11,7 @@ CMDIOB2CALL=/IOB/getIob2call?GWIP=
|
||||
|
||||
[IOB]
|
||||
;--- TEST SIMULAZIONE
|
||||
STARTLIST=3017
|
||||
STARTLIST=3018
|
||||
;STARTLIST=SIMUL_01
|
||||
|
||||
;STARTLIST=3015
|
||||
|
||||
@@ -107,6 +107,9 @@
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WebDriver, Version=3.141.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Selenium.WebDriver.3.141.0\lib\net40\WebDriver.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\VersGen\VersGen.cs">
|
||||
|
||||
+23
-1
@@ -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)
|
||||
|
||||
@@ -7,4 +7,5 @@
|
||||
<package id="NLog" version="4.6.2" targetFramework="net40-client" />
|
||||
<package id="PrettyBin" version="1.1.0" targetFramework="net461" />
|
||||
<package id="S7netplus" version="0.1.9" targetFramework="net40-client" />
|
||||
<package id="Selenium.WebDriver" version="3.141.0" targetFramework="net40-client" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user