Skip to content

ravi0213/rust-headless-chrome

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

154 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Headless Chrome

Build Status Crate API

Puppeteer for Rust. It looks a little something like this:

use headless_chrome::browser::{Browser, LaunchOptions};

let browser = Browser::new(LaunchOptions {  
    headless: true,  
    path: "/usr/bin/google-chrome", // BYO Chrome binary
   ..Default::default()  
})?;  

let tab = browser.wait_for_initial_tab()?;
	
tab.navigate_to("https://www.wikipedia.org")?;  
  
tab.wait_for_element("input#searchInput")?.click()?;
  
tab.type_str("WebKit")?;  
tab.press_key("Enter")?;  
  
tab.wait_for_element("#firstHeading")?;  
  
assert_eq!(true, tab.get_url().ends_with("WebKit"));

For fuller examples, take a look at tests/integration.rs.

Missing features

  • Documentation
  • Frame / iframe support
  • window.alert handlers

Contributing

Pull requests and issues are most welcome, even if they're just experience reports. If you find anything frustrating or confusing, let me know!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 98.8%
  • HTML 1.2%