-
Notifications
You must be signed in to change notification settings - Fork 496
/
coop.py
51 lines (38 loc) · 1.18 KB
/
coop.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from ._abstract import AbstractScraper
class Coop(AbstractScraper):
@classmethod
def host(cls):
return "coop.se"
def author(self):
return self.schema.author()
def title(self):
return self.schema.title()
def category(self):
return self.schema.category()
def cook_time(self):
return self.schema.cook_time()
def yields(self):
return self.schema.yields()
def image(self):
image = self.schema.image()
if image is None or image == '':
image = self.schema.data.get("image")
if (
image
and isinstance(image, list)
and len(image) >= 1
and isinstance(image[0], str)
and image[0].startswith("//")
):
image = "https:" + image[0]
return image
def ingredients(self):
return self.schema.ingredients()
def instructions(self):
return self.schema.instructions()
def ratings(self):
return self.schema.ratings()
def cuisine(self):
return self.schema.cuisine()
def description(self):
return self.schema.description()