5 Star 26 Fork 13

进击的码农 / SeleniumUtil

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.en.md 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
Token 提交于 2022-11-21 16:52 . 新增 wait功能

SeleniumUtil

NuGet NuGet

document language : English | 简体中文

Description

Selenium Simplified toolkit that contains some basic operations for all three major browsers

Sample tool site

Installing a plug-in

In the tool=》NuGet package manager =》Package manager console

Install-Package SeleniumUtil 

Use SeleniumUtil to access Baidu

using SeleniumUtil;

var data=new CrawlerMain(browser:BrowserEnum.Edge,isEnableVerboseLogging:true);
data.GoToUrl("https://www.baidu.com/"); //access a website 
var wd = data.FindElementsById("kw"); //Get the input box
wd.SendKeys("Selenium"); //The input
var su = data.FindElementsById("su");//Get the search button
su.Click();//click
data.Wait(By.Id("content_left"), TimeSpan.FromSeconds(10)); //Wait for the interface to complete loading
var content_left = data.FindElementsById("content_left"); // Access to content
Console.WriteLine(content_left.Text);
Console.ReadKey();
C#
1
https://gitee.com/attacking-code-farmer/selenium-util.git
git@gitee.com:attacking-code-farmer/selenium-util.git
attacking-code-farmer
selenium-util
SeleniumUtil
master

搜索帮助