-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update headless chrome #2
Conversation
@@ -6,7 +6,7 @@ edition = "2018" | |||
description = "ジョブカン CLI" | |||
|
|||
[dependencies] | |||
headless_chrome = { git = "https://github.com/ksk001100/rust-headless-chrome", branch = "feature/add-wait-for-url" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2020年3月時点なので v0.9.0 をベースにしていたようでした
@@ -9,7 +9,7 @@ pub fn punch_in_action(c: &Context) { | |||
let sp = Spinner::new(Spinners::Moon, color::green("Waiting...")); | |||
let jobcan = Jobcan::new(email(c), password(c)); | |||
let browser = Browser::default().unwrap(); | |||
let tab = browser.wait_for_initial_tab().unwrap(); | |||
let tab = browser.new_tab().unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このPRでdeprecatedになりました
rust-headless-chrome/rust-headless-chrome#368
@@ -6,8 +6,7 @@ edition = "2018" | |||
description = "ジョブカン CLI" | |||
|
|||
[dependencies] | |||
headless_chrome = { git = "https://github.com/ksk001100/rust-headless-chrome", branch = "feature/add-wait-for-url" } | |||
failure = "0.1.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::error::Error
を使うようになったので不要になりました
@@ -29,14 +30,15 @@ impl Jobcan { | |||
tab.wait_for_element_with_custom_timeout("input.form__login", Duration::from_secs(60))? | |||
.click()?; | |||
|
|||
tab.wait_for_url("https://ssl.jobcan.jp/employee")?; | |||
// in https://ssl.jobcan.jp/employee | |||
tab.wait_for_element_with_custom_timeout("h3#working_status", Duration::from_secs(20))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このやり方で一応自分の環境では動作していました
自分が想定できていないケースで動作しないこともありそうなので何かあれば指摘ください 🙏
@konifar ありがとうございます!マージします! |
Thanks for awesome cli! This will reduce my boring job! 😉
やったこと
rust-headless-chrome のバージョンを v0.9.0 から v1.0.5 に上げました。
経緯
masterブランチで
jobcan status
をした際、次のエラーが出ていました。確認した環境は以下です。
最小構成のコードで確認してみても
Browser::default()
で同じエラーが発生していました。試しに rust-headless-chrome を最新バージョンにしてみたところ成功したのでアップデートしました。
GitHub Releasesを見てみたんですが、どの修正によって解決したのかはまだわかっていません 🙇
確認したこと
jobcan status
でステータスが表示されるjobcan
で打刻される