diff options
Diffstat (limited to 'parser/artoftea.fnl')
| -rw-r--r-- | parser/artoftea.fnl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/parser/artoftea.fnl b/parser/artoftea.fnl index 773f038..5c7efff 100644 --- a/parser/artoftea.fnl +++ b/parser/artoftea.fnl @@ -26,8 +26,7 @@ (* (parser.anywhere (parser.tag :option {:value "*" :selected "selected"} - (* (peg.Cg parser.pegs.number :weight) (+ (peg.P "г") " гр") - parser.pegs.spaces))) + (peg.Cg (parser.till "</option>") :weight))) (parser.anywhere (parser.tag :p {:class "price"} (parser.tag :span {:id "*"} @@ -41,8 +40,10 @@ (fn normalize [product] (local year (parser.guess-year product.title)) - (local weight (number.string->number product.weight)) + (local weight (or (parser.guess-weight product.weight ["г"]) + (parser.guess-weight product.title))) (local price (number.string->number product.price)) + {:site "artoftea" :title product.title :url product.url |
