|
@@ -23,9 +23,15 @@ fn scrape_feats(url: &str) {
|
|
|
header = false;
|
|
|
} else {
|
|
|
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();
|
|
|
+ let name_raw = tds.next().unwrap().text();
|
|
|
+ let prereqs_raw = tds.next().unwrap().text();
|
|
|
+ let benefit_raw = tds.next().unwrap().text();
|
|
|
+
|
|
|
+ // extra variables because '....unwrap().text().trim()' complains
|
|
|
+ // about lifetime of borrowd value
|
|
|
+ let name = name_raw.trim();
|
|
|
+ let prereqs = prereqs_raw.trim();
|
|
|
+ let benefit = benefit_raw.trim();
|
|
|
|
|
|
println!("|{}|{}|{}|", name, prereqs, benefit);
|
|
|
}
|