Skip to content

keenua/Browsing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Browsing

A wrapper for C#'s WebClient

Uses HtmlAgilityPack library to extend the functionality of the standard .Net WebClient. An useful tool to create web crawlers and parsers.

An example of logging in to GitHub

Browser browser = new Browser();
browser.Encoding = Encoding.UTF8;

// Navigate to the login page
var loginPage = browser.Navigate("https://github.com/login");

// Extract arguments from the login form using xpath
var loginArgs = browser.ExtractArgs(loginPage, @"//div[@id='login']/form");

// Set arguments
loginArgs["login"].SetValue("your_login");
loginArgs["password"].SetValue("your_password");

// Post those arguments
var resultPage = browser.Post("https://github.com/session", loginArgs, false, true);

// Save the page to file
resultPage.Save("result.html");

About

A wrapper for C#'s WebClient

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages