Skip to content

Commit

Permalink
fix: use last container to parse the process' info
Browse files Browse the repository at this point in the history
  • Loading branch information
hails committed Mar 20, 2020
1 parent fbd78fe commit 71fd9c1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ scraper = { git = "https://github.com/causal-agent/scraper"}
reqwest = { version = "0.10.4" }
select = {version = "0.4.3"}
regex = "1"

2 changes: 1 addition & 1 deletion src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async fn fetch_citizenship_status(code: &String) -> Result<Process, reqwest::Err
process.status = st.text();
}

if let Some(st) = document.find(Class("container")).nth(5) {
if let Some(st) = document.find(Class("container")).last() {
let re = Regex::new(r"\s+").unwrap();

process.info = re.replace_all(&st.text(), " ").trim().to_string();
Expand Down

0 comments on commit 71fd9c1

Please sign in to comment.