Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Crawljax setup with custom browser builder that sets a Cookie.
public class Test {
static class MyProvider implements Provider<EmbeddedBrowser> {
public EmbeddedBrowser get() {
EmbeddedBrowser browser2;
browser2 = newFireFoxBrowser();
return browser2;
private EmbeddedBrowser newFireFoxBrowser() {
FirefoxProfile profile = new FirefoxProfile();
WebDriver drivertest = new FirefoxDriver(profile);
Cookie test1 = new Cookie("a", "1234");
return WebDriverBackedEmbeddedBrowser.withDriver(drivertest);
public static void main(String[] args) {
BrowserConfiguration browserConfg =
new BrowserConfiguration(BrowserType.FIREFOX, 1, new MyProvider());
CrawljaxConfiguration config =
CrawlSession runner = new CrawljaxRunner(config).call();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment