diff --git a/event_notification/python/scrape_event.py b/event_notification/python/scrape_event.py index aa5d65d1..385968cb 100644 --- a/event_notification/python/scrape_event.py +++ b/event_notification/python/scrape_event.py @@ -62,6 +62,8 @@ class unloze_spider(scrapy.Spider): next_event_time = False next_event_reward = False event_date = None + event_reward = "" + event_time = "" for r in response.xpath("//*[contains(text(),'TL;DR')]/../../..//text()").extract(): if "\n" in r or len(r) < 4 or "\t" in r or skipping > 0: if r.lower() == "tl;dr": @@ -95,14 +97,16 @@ class unloze_spider(scrapy.Spider): if "time" in r.lower() and "server" not in r.lower(): next_event_time = True continue - if next_event_time: + if next_event_time and event_time == "": event_time = r next_event_time = False if "rewards" in r.lower(): next_event_reward = True + #print("rewards: ", r) continue - if next_event_reward: + if next_event_reward and event_reward == "": + #print("next_event_reward: ", r) event_reward = r next_event_reward = False @@ -123,4 +127,4 @@ class unloze_spider(scrapy.Spider): sys.exit(1) #pprint(self.item) - return self.item + return self.item