[F] Fix while loop logic
This commit is contained in:
@@ -93,8 +93,10 @@ def crawl(item_url: str) -> dict:
|
||||
id = get_url_param(item_url, 'id')
|
||||
out_path = Path(f'crawler/{id}.json')
|
||||
|
||||
if out_path.is_file():
|
||||
return json.loads(out_path.read_text())
|
||||
|
||||
while True:
|
||||
if not out_path.is_file():
|
||||
print(f'Crawling {id}...')
|
||||
out_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
resp = r.post('https://front.superbuy.com/crawler/', data={"needSoldOutSkuInfo": 1, "location": 2, "goodUrl": item_url})
|
||||
|
||||
Reference in New Issue
Block a user