Add default depth

pull/1/head
Raphaël Vinot 2017-08-27 22:29:44 +02:00
parent 2cb9a871c7
commit 500fa35670
2 changed files with 3 additions and 1 deletions

View File

@ -40,6 +40,8 @@ def scrap():
if request.form.get('url'):
url = request.form.get('url')
depth = request.form.get('depth')
if depth is None:
depth = 1
items = crawl(SPLASH, url, depth)
if not items:
# broken

View File

@ -8,7 +8,7 @@
<form class="form-inline" role="form" action="scrap" method=post>
<div class="form-group">
<input type="text" class="form-control" name="url" id=url placeholder="URL to scrap">
<input type="text" class="form-control" name="depth" id=depth placeholder="Depth">
<input type="text" class="form-control" name="depth" id=depth value=1 placeholder="Depth">
</div>
<button type="submit" class="btn btn-default">Scrap</button>
</form>