-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dmy.berezovskyi
committed
Jan 16, 2025
1 parent
ebbcdce
commit 1d64dd9
Showing
8 changed files
with
220 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import argparse | ||
from pathlib import Path | ||
|
||
from utils.scraper.chrome_scraper import ChromePageScraper | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(prog="psaf", description="PSAF CLI Tool") | ||
|
||
# Subcommand for 'get' operations | ||
subparsers = parser.add_subparsers(dest="command") | ||
|
||
# Subcommand for 'get chromedriver' | ||
get_parser = subparsers.add_parser("get", help="Get a specific resource") | ||
get_subparsers = get_parser.add_subparsers(dest="resource") | ||
|
||
# Subcommand for 'chromedriver' under 'get' | ||
chromedriver_parser = get_subparsers.add_parser( | ||
"chromedriver", help="Download the ChromeDriver" | ||
) | ||
chromedriver_parser.add_argument( | ||
"--platform", | ||
type=str, | ||
help="Specify the platform (e.g., 'win32', 'linux64').", | ||
) | ||
chromedriver_parser.add_argument( | ||
"--version", | ||
type=str, | ||
help="Specify the version of ChromeDriver.", | ||
) | ||
chromedriver_parser.add_argument( | ||
"--milestone", | ||
type=str, | ||
help="Specify the milestone of ChromeDriver.", | ||
) | ||
chromedriver_parser.add_argument( | ||
"--output-dir", | ||
type=str, | ||
help="Directory to save the downloaded ChromeDriver.", | ||
) | ||
chromedriver_parser.add_argument( | ||
"--extract", | ||
action="store_true", | ||
help="Extract the downloaded ChromeDriver.", | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
if args.command == "get" and args.resource == "chromedriver": | ||
output_dir = Path(args.output_dir) if args.output_dir else None | ||
ChromePageScraper.get_chromedriver( | ||
platform=args.platform, | ||
version=args.version, | ||
milestone=args.milestone, | ||
d_dir=output_dir, | ||
is_extracted=args.extract, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.