-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add a flag to crawl only the root website #14
Conversation
@@ -53,6 +55,8 @@ def __init__(self, | |||
self.max_workers: int = max_workers | |||
self.delay: float = delay | |||
self.verbose: bool = verbose | |||
self.stay_within_domain: bool = stay_within_domain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use the name internal_links_only
as a flag because I want to provide option for crawling external links later which can be named as external_links_only
. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure we can do
Also please check this |
print(Fore.GREEN + f"Crawling: {root_url}") | ||
crawler.start() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() | ||
main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this missing last new line is causing lint to fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please add a test case. Thanks!
Closing due to inactivity. /cc @Mews @devavinothm |
Explanation of Changes
Added stay_within_domain Parameter:
Stored Root Domain:
Filtered Links:
I hope this solves the issue.