Browse Source

first try at a fix

jmelesky 7 years ago
parent
commit
685016334c
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/main.rs

+ 5 - 4
src/main.rs

@@ -22,11 +22,12 @@ fn scrape_feats(url: &str) {
         if header {
             header = false;
         } else {
-            let name = node.find(Name("td")).next().unwrap().text();
-            let prereqs = node.find(Name("td")).next().unwrap().text();
-            let benefit = node.find(Name("td")).next().unwrap().text();
+            let mut tds = node.find(Name("td"));
+            let name = tds.next().unwrap().text();
+            let prereqs = tds.next().unwrap().text();
+            let benefit = tds.next().unwrap().text();
 
-            println!("|{}|{}|{}|\n", name, prereqs, benefit);
+            println!("|{}|{}|{}|", name, prereqs, benefit);
         }
     }