Utilisation de URL
This commit is contained in:
commit
e48ac85011
7 changed files with 25 additions and 11 deletions
|
@ -1,6 +1,7 @@
|
|||
use super::Parser;
|
||||
use crate::PriceResult;
|
||||
use scraper::{Selector, Html};
|
||||
use url::Url;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Darty {
|
||||
|
@ -18,8 +19,8 @@ impl Parser for Darty {
|
|||
}
|
||||
}
|
||||
|
||||
fn can_parse(&self, url : &str) -> bool {
|
||||
url.contains("darty")
|
||||
fn can_parse(&self, url : &Url) -> bool {
|
||||
url.host_str().unwrap() == "www.darty.com"
|
||||
}
|
||||
|
||||
fn parse(&self, html : &Html) -> PriceResult {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue