#!/usr/bin/env python3

import click
from brand_car_scraper.main import car_scraper


@click.command()
@click.argument('output_file', type=click.Path(exists=False))
@click.option('--fp', type=click.INT, default=1, help='First page to be parsed. Default value is 1.')
@click.option('--tp', type=click.INT, default=None, help='Last page to be parsed, i.e. until the last page.')
@click.option('--region', type=click.STRING, default="madrid", help='Region to be parsed e.g. madrid.')
def scrap(output_file, fp=1, tp=None, region="madrid"):
    """This tool scraps list of second car ads at https://www.coches.net/segunda-mano/?pg=<page_number> where
    <page_number is an integer greater or equal than 1.

    If no OPTIONS are provided all the pages will be parsed.

    OUTPUT_FILE a path where the csv file will be stored.

    \b
    Examples:
        - For scraping from page 1 to the end, region madrid:
            $ scrap out.csv
        - For scraping from page 1 to 10, region madrid:
            $ scrap --tp 10 out.csv
        - For scraping from page 5 to 10, region madrid:
            $ scrap -fp 5 -tp 10 out.csv
        - For scraping from page 5, region madrid:
            $ scrap -fp 5 out.csv
        - For scraping from page 5 to 10, region murcia:
            $ scrap -fp 5 -tp 10 --region murcia out.csv

    \b
    AUTHORS:
        - Pedro Uceda Martinez\b
        - Pablo Campillo Sánchez
    """
    click.secho(f"car_scraper({output_file}, {fp}, {tp}, {region})", fg='green')
    car_scraper(output_file, fp, tp, region)


if __name__ == '__main__':
    scrap()

f80fd455e6f3bfa24723e22412a4b2d9f57b0345
<mask token>

<mask token>


@click.command()
@click.argument('output_file', type=click.Path(exists=False))
@click.option('--fp', type=click.INT, default=1, help=
    'First page to be parsed. Default value is 1.')
@click.option('--tp', type=click.INT, default=None, help=
    'Last page to be parsed, i.e. until the last page.')
@click.option('--region', type=click.STRING, default='madrid', help=
    'Region to be parsed e.g. madrid.')
def scrap(output_file, fp=1, tp=None, region='madrid'):
    """This tool scraps list of second car ads at https://www.coches.net/segunda-mano/?pg=<page_number> where
    <page_number is an integer greater or equal than 1.

    If no OPTIONS are provided all the pages will be parsed.

    OUTPUT_FILE a path where the csv file will be stored.

    
    Examples:
        - For scraping from page 1 to the end, region madrid:
            $ scrap out.csv
        - For scraping from page 1 to 10, region madrid:
            $ scrap --tp 10 out.csv
        - For scraping from page 5 to 10, region madrid:
            $ scrap -fp 5 -tp 10 out.csv
        - For scraping from page 5, region madrid:
            $ scrap -fp 5 out.csv
        - For scraping from page 5 to 10, region murcia:
            $ scrap -fp 5 -tp 10 --region murcia out.csv

    
    AUTHORS:
        - Pedro Uceda Martinez
        - Pablo Campillo Sánchez
    """
    click.secho(f'car_scraper({output_file}, {fp}, {tp}, {region})', fg='green'
        )
    car_scraper(output_file, fp, tp, region)


<mask token>

<mask token>


@click.command()
@click.argument('output_file', type=click.Path(exists=False))
@click.option('--fp', type=click.INT, default=1, help=
    'First page to be parsed. Default value is 1.')
@click.option('--tp', type=click.INT, default=None, help=
    'Last page to be parsed, i.e. until the last page.')
@click.option('--region', type=click.STRING, default='madrid', help=
    'Region to be parsed e.g. madrid.')
def scrap(output_file, fp=1, tp=None, region='madrid'):
    """This tool scraps list of second car ads at https://www.coches.net/segunda-mano/?pg=<page_number> where
    <page_number is an integer greater or equal than 1.

    If no OPTIONS are provided all the pages will be parsed.

    OUTPUT_FILE a path where the csv file will be stored.

    
    Examples:
        - For scraping from page 1 to the end, region madrid:
            $ scrap out.csv
        - For scraping from page 1 to 10, region madrid:
            $ scrap --tp 10 out.csv
        - For scraping from page 5 to 10, region madrid:
            $ scrap -fp 5 -tp 10 out.csv
        - For scraping from page 5, region madrid:
            $ scrap -fp 5 out.csv
        - For scraping from page 5 to 10, region murcia:
            $ scrap -fp 5 -tp 10 --region murcia out.csv

    
    AUTHORS:
        - Pedro Uceda Martinez
        - Pablo Campillo Sánchez
    """
    click.secho(f'car_scraper({output_file}, {fp}, {tp}, {region})', fg='green'
        )
    car_scraper(output_file, fp, tp, region)


if __name__ == '__main__':
    scrap()

import click
from brand_car_scraper.main import car_scraper


@click.command()
@click.argument('output_file', type=click.Path(exists=False))
@click.option('--fp', type=click.INT, default=1, help=
    'First page to be parsed. Default value is 1.')
@click.option('--tp', type=click.INT, default=None, help=
    'Last page to be parsed, i.e. until the last page.')
@click.option('--region', type=click.STRING, default='madrid', help=
    'Region to be parsed e.g. madrid.')
def scrap(output_file, fp=1, tp=None, region='madrid'):
    """This tool scraps list of second car ads at https://www.coches.net/segunda-mano/?pg=<page_number> where
    <page_number is an integer greater or equal than 1.

    If no OPTIONS are provided all the pages will be parsed.

    OUTPUT_FILE a path where the csv file will be stored.

    
    Examples:
        - For scraping from page 1 to the end, region madrid:
            $ scrap out.csv
        - For scraping from page 1 to 10, region madrid:
            $ scrap --tp 10 out.csv
        - For scraping from page 5 to 10, region madrid:
            $ scrap -fp 5 -tp 10 out.csv
        - For scraping from page 5, region madrid:
            $ scrap -fp 5 out.csv
        - For scraping from page 5 to 10, region murcia:
            $ scrap -fp 5 -tp 10 --region murcia out.csv

    
    AUTHORS:
        - Pedro Uceda Martinez
        - Pablo Campillo Sánchez
    """
    click.secho(f'car_scraper({output_file}, {fp}, {tp}, {region})', fg='green'
        )
    car_scraper(output_file, fp, tp, region)


if __name__ == '__main__':
    scrap()

#!/usr/bin/env python3

import click
from brand_car_scraper.main import car_scraper


@click.command()
@click.argument('output_file', type=click.Path(exists=False))
@click.option('--fp', type=click.INT, default=1, help='First page to be parsed. Default value is 1.')
@click.option('--tp', type=click.INT, default=None, help='Last page to be parsed, i.e. until the last page.')
@click.option('--region', type=click.STRING, default="madrid", help='Region to be parsed e.g. madrid.')
def scrap(output_file, fp=1, tp=None, region="madrid"):
    """This tool scraps list of second car ads at https://www.coches.net/segunda-mano/?pg=<page_number> where
    <page_number is an integer greater or equal than 1.

    If no OPTIONS are provided all the pages will be parsed.

    OUTPUT_FILE a path where the csv file will be stored.

    \b
    Examples:
        - For scraping from page 1 to the end, region madrid:
            $ scrap out.csv
        - For scraping from page 1 to 10, region madrid:
            $ scrap --tp 10 out.csv
        - For scraping from page 5 to 10, region madrid:
            $ scrap -fp 5 -tp 10 out.csv
        - For scraping from page 5, region madrid:
            $ scrap -fp 5 out.csv
        - For scraping from page 5 to 10, region murcia:
            $ scrap -fp 5 -tp 10 --region murcia out.csv

    \b
    AUTHORS:
        - Pedro Uceda Martinez\b
        - Pablo Campillo Sánchez
    """
    click.secho(f"car_scraper({output_file}, {fp}, {tp}, {region})", fg='green')
    car_scraper(output_file, fp, tp, region)


if __name__ == '__main__':
    scrap()
