let proxy = format!("http://{}:{}", "host", "port");
let launch_options = LaunchOptions::default_builder()
.path(Some(browser::default_executable().unwrap()))
.proxy_server(Some(&proxy))
.build()
.unwrap();
let browser = Browser::new(launch_options).expect("Failed to launch browser");
let tab = browser.new_tab().unwrap();
tab.wait_until_navigated().unwrap();
tab.enable_fetch(None, Some(true)).unwrap()
.authenticate(Some("username".to_string()), Some("password".to_string())).unwrap()
.navigate_to("/?src=header&redirect_to=%2F").unwrap()
.wait_until_navigated().unwrap();
The above code is to launch new browser and new tab that have proxy with authentication.
After loading page, I tried to get the cookies using let cookies = tab.call_method(GetAllCookies(Default::default())).expect("Error getting cookies");
, but it shows the error: invalid type: map, expected a string
How to fix this problem?