Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extracting data from web page (table etc); will HtmlDoc be included in LA?
#18
This script uses an existing Chrome instance which must be started with a special command line.

Code:
Copy      Help
// script ""
/*/ nuget selenium\Selenium.Support; nuget selenium\Selenium.WebDriver.ChromeDriver; /*/
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Interactions;
using OpenQA.Selenium.Support.Extensions;
using OpenQA.Selenium.Support.UI;
script.setup(trayIcon: true, sleepExit: true, exitKey: KKey.MediaStop, pauseKey: KKey.MediaPlayPause);
print.clear();

//Chrome must be launched with command line like this:
//run.it("chrome.exe", "--remote-debugging-port=9222");
////run.it("chrome.exe", $"--remote-debugging-port=9222 --user-data-dir=\"{folders.LocalAppData + @"Google\Chrome\User Data"}\"");


ChromeOptions options = new() { DebuggerAddress = "127.0.0.1:9222" };
var service = ChromeDriverService.CreateDefaultService();
service.HideCommandPromptWindow = true;
using var driver = new ChromeDriver(service, options);
driver.Manage().Window.Maximize();

for (int i = 1; i <= 2; i++) {
    script.pause();
    driver.Navigate().GoToUrl($"https://filecr.com/ms-windows/?page={i}"); //opens and waits until loaded
    1.s();
}


Messages In This Thread
RE: Will HtmlDoc be included in LA? - by Gintaras - 05-14-2023, 07:34 AM
RE: Will HtmlDoc be included in LA? - by birdywen - 05-14-2023, 12:10 PM
RE: Will HtmlDoc be included in LA? - by Gintaras - 05-14-2023, 12:31 PM
RE: Will HtmlDoc be included in LA? - by birdywen - 05-14-2023, 12:44 PM
RE: Will HtmlDoc be included in LA? - by birdywen - 05-20-2023, 02:58 PM
RE: Will HtmlDoc be included in LA? - by Gintaras - 05-20-2023, 04:07 PM
RE: Will HtmlDoc be included in LA? - by birdywen - 05-20-2023, 04:27 PM
RE: Will HtmlDoc be included in LA? - by birdywen - 05-27-2023, 06:18 AM
RE: Will HtmlDoc be included in LA? - by Gintaras - 05-27-2023, 07:16 AM
RE: Will HtmlDoc be included in LA? - by birdywen - 05-27-2023, 07:23 AM
RE: Will HtmlDoc be included in LA? - by birdywen - 05-31-2023, 03:13 AM
RE: Will HtmlDoc be included in LA? - by Gintaras - 05-31-2023, 04:05 AM
RE: Will HtmlDoc be included in LA? - by Gintaras - 05-31-2023, 04:25 AM
RE: Extracting data from web page (table etc); will HtmlDoc be included in LA? - by Gintaras - 06-01-2023, 08:37 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)