- commit
- e3c1e50b02544ba72fb29bfcc1928dee3b24ea5a
- parent
- a84d73e9b1cffd6caf4a6396ecbef5a7176e6add
- Author
- Tobias Bengfort <tobias.bengfort@gmx.net>
- Date
- 2015-12-03 23:05
null instead of 500 if selector does not match
Diffstat
| M | jsonproxy/api.py | 4 | +++- |
1 files changed, 3 insertions, 1 deletions
diff --git a/jsonproxy/api.py b/jsonproxy/api.py
@@ -45,7 +45,9 @@ def get_attribute_list(html, selector): 45 45 46 46 47 47 def get_attribute(html, selector):48 -1 return get_attribute_list(html, selector)[0]-1 48 l = get_attribute_list(html, selector) -1 49 if len(l) > 0: -1 50 return l[0] 49 51 50 52 51 53 def scrape_item(url, config):