fixed rewards and maybe time too?
This commit is contained in:
parent
f0951685d4
commit
8de630351c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user