websucker-pip/mongo/cli.py

34 lines
579 B
Python
Raw Normal View History

2023-04-09 07:13:15 +00:00
import click
import mongocrawler
@click.group()
def cli():
pass
@cli.command()
def createdb():
mongocrawler.createdb()
@cli.command()
@click.argument("link")
def parseurl(link):
mongocrawler.parseurl(link)
@cli.command()
@click.argument("link")
def externaldomains(link):
mongocrawler.externaldomains(link)
@cli.command()
@click.argument("start_link")
def classify(start_link):
mongocrawler.classify(start_link)
@cli.command()
@click.argument("start_link")
def visit(start_link):
mongocrawler.visit(start_link)
if __name__ == "__main__":
cli()