added varda to run_spiders script.
This commit is contained in:
parent
36312daf87
commit
83239dd637
@ -14,6 +14,7 @@ valsaren_file = dir / "valsaren.json"
|
|||||||
malmens_file = dir / "malmens.json"
|
malmens_file = dir / "malmens.json"
|
||||||
heat_file = dir / "heat.json"
|
heat_file = dir / "heat.json"
|
||||||
max_file = dir / "max.json"
|
max_file = dir / "max.json"
|
||||||
|
varda_file = dir / "varda.json"
|
||||||
|
|
||||||
def dagens_lunch_results():
|
def dagens_lunch_results():
|
||||||
results = []
|
results = []
|
||||||
@ -41,6 +42,9 @@ def dagens_lunch_results():
|
|||||||
if max_file.is_file() and max_file.exists():
|
if max_file.is_file() and max_file.exists():
|
||||||
print(f"removing {max_file.name}")
|
print(f"removing {max_file.name}")
|
||||||
max_file.unlink()
|
max_file.unlink()
|
||||||
|
if varda_file.is_file() and varda_file.exists():
|
||||||
|
print(f"removing {varda_file.name}")
|
||||||
|
varda_file.unlink()
|
||||||
|
|
||||||
dispatcher.connect(crawler_results, signal=signals.item_scraped)
|
dispatcher.connect(crawler_results, signal=signals.item_scraped)
|
||||||
|
|
||||||
@ -54,6 +58,7 @@ def dagens_lunch_results():
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
_valsaren = None
|
_valsaren = None
|
||||||
_malmens = None
|
_malmens = None
|
||||||
|
_varda = None
|
||||||
_heat = None
|
_heat = None
|
||||||
_max = None
|
_max = None
|
||||||
res = dagens_lunch_results()
|
res = dagens_lunch_results()
|
||||||
@ -72,6 +77,8 @@ if __name__ == "__main__":
|
|||||||
_heat = json.dumps(dict(item))
|
_heat = json.dumps(dict(item))
|
||||||
elif item["place"].split(" ")[0].lower() == "max":
|
elif item["place"].split(" ")[0].lower() == "max":
|
||||||
_max = json.dumps(dict(item))
|
_max = json.dumps(dict(item))
|
||||||
|
elif item["place"].split(" ")[0].lower() == "varda":
|
||||||
|
_varda = json.dumps(dict(item))
|
||||||
elif item["place"].split(" ")[0].lower() == "unknown":
|
elif item["place"].split(" ")[0].lower() == "unknown":
|
||||||
print(f"please learn me more about {item['place']}")
|
print(f"please learn me more about {item['place']}")
|
||||||
f.write("\n]")
|
f.write("\n]")
|
||||||
@ -83,6 +90,9 @@ if __name__ == "__main__":
|
|||||||
malmens_file.write_text(_malmens)
|
malmens_file.write_text(_malmens)
|
||||||
print(f"created: {malmens_file}")
|
print(f"created: {malmens_file}")
|
||||||
|
|
||||||
|
varda_file.write_text(_varda)
|
||||||
|
print(f"created: {varda_file}")
|
||||||
|
|
||||||
heat_file.write_text(_heat)
|
heat_file.write_text(_heat)
|
||||||
print(f"created: {heat_file}")
|
print(f"created: {heat_file}")
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user