Comments (4)
You could also stick a call to wait_for_navigation
inside that loop. That should help.
from fantoccini.
Hmm, that's strange. It seems to work fine for me?
extern crate fantoccini;
extern crate futures;
extern crate tokio_core;
use fantoccini::Client;
fn main() {
let mut core = tokio_core::reactor::Core::new().unwrap();
let c = Client::new("http://127.0.0.1:4444", &core.handle());
let c = core.run(c).unwrap();
core.run(c.goto("https://www.goteborgenergi.se/Mina_sidor"))
.unwrap();
for _ in 0..20 {
println!("{:?}", core.run(c.current_url()));
::std::thread::sleep(::std::time::Duration::from_millis(100));
}
core.run(c.close()).unwrap();
}
$ cargo +nightly r
Compiling y v0.1.0 (file:///home/jon/tmp/y)
Finished dev [unoptimized + debuginfo] target(s) in 4.9 secs
Running `target/debug/y`
Ok("https://www.goteborgenergi.se/my.policy")
Ok("https://www.goteborgenergi.se/my.policy")
Ok("https://www.goteborgenergi.se/my.policy")
Ok("https://www.goteborgenergi.se/my.policy")
Ok("https://www.goteborgenergi.se/my.policy")
Ok("https://www.goteborgenergi.se/my.policy")
Ok("https://www.goteborgenergi.se/my.policy")
Ok("https://idpaut.service.tieto.com/idp/gbgenergi/authenticate/authGbgF51UnPw")
Ok("https://idpaut.service.tieto.com/idp/gbgenergi/authenticate/authGbgF51UnPw")
Ok("https://idpaut.service.tieto.com/idp/gbgenergi/authenticate/authGbgF51UnPw")
Ok("https://idpaut.service.tieto.com/idp/gbgenergi/authenticate/authGbgF51UnPw")
Ok("https://idpaut.service.tieto.com/idp/gbgenergi/authenticate/authGbgF51UnPw")
Ok("https://idpaut.service.tieto.com/idp/gbgenergi/authenticate/authGbgF51UnPw")
Ok("https://idpaut.service.tieto.com/idp/gbgenergi/authenticate/authGbgF51UnPw")
Ok("https://idpaut.service.tieto.com/idp/gbgenergi/authenticate/authGbgF51UnPw")
Ok("https://idpaut.service.tieto.com/idp/gbgenergi/authenticate/authGbgF51UnPw")
Ok("https://idpaut.service.tieto.com/idp/gbgenergi/authenticate/authGbgF51UnPw")
Ok("https://idpaut.service.tieto.com/idp/gbgenergi/authenticate/authGbgF51UnPw")
Ok("https://idpaut.service.tieto.com/idp/gbgenergi/authenticate/authGbgF51UnPw")
Ok("https://idpaut.service.tieto.com/idp/gbgenergi/authenticate/authGbgF51UnPw")
Or am I missing something?
from fantoccini.
It seems I did not wait long enough. I was calling current_url()
2-3 times immediately after goto()
and then it was always returning the intermediary url.
I will try adding a loop and check the current_url()
until it gets to the authentication page.
Thanks a lot for your help.
from fantoccini.
Sure thing! For what it's worth, it looks like chromedriver
gets to the final page a great deal faster than geckodriver
does. Don't know if it matters to you though :)
from fantoccini.
Related Issues (20)
- Comparison to thirtyfour HOT 20
- Don't silently hit a URL for raw client cookie support HOT 3
- Consider merging Session::endpoint_for() with the enum in Session::issue_wd_cmd() HOT 2
- Minimize instances where mutable access to self is required
- Scraping? HOT 1
- Add Trait for supporting other WebDriver-compatible commands (CDP, Selenium, Appium, etc) HOT 4
- Element send_keys can't send '@' HOT 3
- Unable to switch window in fantoccini. HOT 1
- Bug: Search element from element does not start search from there HOT 3
- Q: transferring reqwest cookies to fantoccini HOT 1
- webdriver should not panic on invalid argument HOT 3
- Adding support for headless browser? HOT 3
- Cannot set `pageLoadOptions` in capabilities HOT 2
- WebAuthn support HOT 1
- BrowserStack requires `charset=utf-8` in `Content-Type` header on Selenium >= 4 HOT 1
- 👋 From the Selenium project! HOT 1
- Cannot access error variant information from webdriver::ErrorStatus enum HOT 1
- `Session::with_capabilities_and_connector` hides the WebDriver response HOT 1
- What's happening here? (fantoccini breaks String + &String) HOT 10
- Error when connecting to browserstack: Session not started or terminated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fantoccini.