Commit 9808c49c authored by Renán Sosa Guillen's avatar Renán Sosa Guillen

crawlers

parent 077afd63
import scrapy import scrapy, re
from datetime import datetime, date, timedelta
from scrapy.spidermiddlewares.httperror import HttpError
## scrapy crawl noticias -t json --nolog -o noticias.json -a year=2016 -a month=12 -a day=24 """
Esta version descarga ingresando una fecha.
USO:
import re scrapy crawl noticias -t json --nolog -o noticias.json -a year=2017 -a month=09 -a day=13
from datetime import datetime, date, timedelta No es recomendable para fechas de más de un mes de antiguas.
from scrapy.spidermiddlewares.httperror import HttpError """
TAG_RE = re.compile(r'<[^>]+>') TAG_RE = re.compile(r'<[^>]+>')
def remove_tags(text): def remove_tags(text):
......
import scrapy import scrapy, re
# from datetime import datetime, date, timedelta
# from scrapy.spidermiddlewares.httperror import HttpError
## scrapy crawl noticias -t json --nolog -o noticias.json """
Esta version descarga todas las noticias contenidas en la pagina, sin necesidad
de una fecha especifica.
USO:
import re scrapy crawl noticias -t json --nolog -o noticias.json
# from datetime import datetime, date, timedelta Genera un archivo JSON con todas las noticias disponibles. El archivo 'parse_date_file.py'
# from scrapy.spidermiddlewares.httperror import HttpError puede servir para clasificar dichas noticias en sus respectivas fechas.
"""
TAG_RE = re.compile(r'<[^>]+>') TAG_RE = re.compile(r'<[^>]+>')
def remove_tags(text): def remove_tags(text):
......
import scrapy import scrapy, re
from datetime import datetime, date, timedelta from datetime import datetime, date, timedelta
""" """
Esta version descarga ingresando una fecha.
USO: USO:
scrapy crawl noticias -t json --nolog -o noticias.json -a year=2017 -a month=2 -a day=21 scrapy crawl noticias -t json --nolog -o noticias.json -a year=2017 -a month=2 -a day=21
"""
import re No es recomendable para fechas de más de un mes de antiguas.
"""
TAG_RE = re.compile(r'<[^>]+>') TAG_RE = re.compile(r'<[^>]+>')
def remove_tags(text): def remove_tags(text):
......
import scrapy, re import scrapy, re
""" """
Esta version descarga todas las noticias contenidas en la pagina, sin necesidad
de una fecha especifica.
USO: USO:
scrapy crawl noticias -t json --nolog -o noticias.json scrapy crawl noticias -t json --nolog -o noticias.json
Genera un archivo JSON con todas las noticias disponibles. El archivo 'parse_date_file.py'
puede servir para clasificar dichas noticias en sus respectivas fechas.
""" """
TAG_RE = re.compile(r'<[^>]+>') TAG_RE = re.compile(r'<[^>]+>')
......
import scrapy import scrapy, json, re
import json
from datetime import datetime, date, timedelta from datetime import datetime, date, timedelta
#scrapy crawl noticias -t json --nolog -o noticias.json -a year=2017 -a month=3 -a day=22 """
Esta version descarga ingresando una fecha.
USO:
import re scrapy crawl noticias -t json --nolog -o noticias.json -a year=2017 -a month=3 -a day=22
No es recomendable para fechas de más de un mes de antiguas.
"""
TAG_RE = re.compile(r'<[^>]+>') TAG_RE = re.compile(r'<[^>]+>')
......
import scrapy import scrapy, json, re
import json
#scrapy crawl noticias -t json -o noticias.json """
Esta version descarga todas las noticias contenidas en la pagina, sin necesidad
de una fecha especifica.
USO:
import re scrapy crawl noticias -t json --nolog -o noticias.json
Genera un archivo JSON con todas las noticias disponibles. El archivo 'parse_date_file.py'
puede servir para clasificar dichas noticias en sus respectivas fechas.
"""
TAG_RE = re.compile(r'<[^>]+>') TAG_RE = re.compile(r'<[^>]+>')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment