Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: None check before regex search #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions web-qa.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,10 @@
" for link in set(get_hyperlinks(url)):\n",
" clean_link = None\n",
"\n",
" # If the link is empty, skip it\n",
" if not link:\n",
" continue\n",
"\n",
" # If the link is a URL, check if it is within the same domain\n",
" if re.search(HTTP_URL_PATTERN, link):\n",
" # Parse the URL and check if the domain is the same\n",
Expand Down
4 changes: 4 additions & 0 deletions web-qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ def get_domain_hyperlinks(local_domain, url):
for link in set(get_hyperlinks(url)):
clean_link = None

# If the link is empty, skip it
if not link:
continue

# If the link is a URL, check if it is within the same domain
if re.search(HTTP_URL_PATTERN, link):
# Parse the URL and check if the domain is the same
Expand Down