Skip to content

Commit

Permalink
Fix type cohersion for int based args
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonrobertz committed May 21, 2020
1 parent 7335673 commit 973be2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions autoscrape/scrapers/manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self, baseurl, loglevel=None, stdout=None, maxdepth=10,
loglevel=loglevel, stdout=stdout
)
if page_timeout is not None:
page_timeout = int(page_timeout)
page_timeout = int(page_timeout or 0)
# set up web scraper controller
self.control = Controller(
leave_host=leave_host, driver=driver, remote_hub=remote_hub,
Expand All @@ -66,9 +66,9 @@ def __init__(self, baseurl, loglevel=None, stdout=None, maxdepth=10,
)
self.control.initialize(baseurl)
# depth of DFS in search of form
self.maxdepth = int(maxdepth)
self.maxdepth = int(maxdepth or 0)
# current depth of iterating through 'next' form buttons
self.formdepth = int(formdepth)
self.formdepth = int(formdepth or 0)
# max total pages to fetch
self.max_pages = int(max_pages) if max_pages else None
# keep number of fetched pages here.
Expand Down Expand Up @@ -108,7 +108,7 @@ def __init__(self, baseurl, loglevel=None, stdout=None, maxdepth=10,
# attempt a position-based "natural click" over the element
self.form_submit_natural_click = form_submit_natural_click
# a period of seconds to force a wait after a submit
self.form_submit_wait = int(form_submit_wait)
self.form_submit_wait = int(form_submit_wait or 0)
# a generator, outputting individual form interaction plans
if input:
self.input_gen = InputParser(input).generate()
Expand Down

0 comments on commit 973be2d

Please sign in to comment.