Skip to content

Commit 1632a6e

Browse files
committed
Fix error when not defining regex
1 parent 486aaae commit 1632a6e

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "dynamic-scraper"
7-
version = "1.1.0"
7+
version = "1.1.1"
88
description = "Dynamic web scraper specifically designed for websites that dynamically load elements (such as AngularJS). It runs at specified time intervals and notifies you about specific updates on the site."
99
readme = "README.md"
1010
requires-python = ">=3.10"

src/web_scraper/utils/argparse.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,17 @@ def collect_arguments() -> argparse.Namespace:
123123
)
124124

125125
args = parser.parse_args()
126+
args = check_arguments(args)
127+
return args
128+
129+
130+
def check_arguments(args: argparse.Namespace) -> None:
131+
"""
132+
Check the arguments passed to the script
133+
"""
134+
135+
# If no regex is provided, use the search string as the regex
136+
if not args.regex:
137+
args.regex = args.search_string
138+
126139
return args

0 commit comments

Comments
 (0)