Utilisation de URL

This commit is contained in:
Rémi BERTHO 2020-05-23 16:19:04 +02:00
commit e48ac85011
Signed by: dalan
GPG key ID: EE3B917931C07B64
7 changed files with 25 additions and 11 deletions

View file

@ -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 {