Scraper para consultar el SIS
Project description
SIS Scraper 🏥
Librería Python para consultas con anti-detección y caché.
Características
- ✅ Anti-detección: User-Agent rotation, headers spoofing, delays aleatorios
- ✅ Caché SQLite: Guarda resultados por 1 año (configurable)
- ✅ OCR automático: Resuelve CAPTCHAs con ddddocr + OpenCV
- ✅ Reintentos automáticos: Si falla el captcha, reintenta
📦 Instalación
pip install sis-scraper
Uso Rápido
Forma Simple (Recomendada)
from sis_scraper import consultar
resultado = consultar("12345678")
if resultado["exito"]:
print(resultado["datos_personales"])
print(resultado["afiliaciones"])
Forma Avanzada (Control total)
from sis_scraper import SisScraperAntiDeteccion
scraper = SisScraperAntiDeteccion(cache_horas=720) # 30 días
resultado = scraper.consultar_con_reintentos("12345678", max_intentos=5)
Uso como CLI
sis-scraper
Estructura del Resultado
{
"exito": true,
"mensaje": "Consulta exitosa",
"datos_personales": {
"nombre": "APELLIDO APELLIDO NOMBRE",
"documento": "DNI 12345678",
"afiliacion": "2-12345678",
"tipo_asegurado": "TITULAR",
"estado": "ACTIVO"
},
"afiliaciones": [
{
"Apellidos y Nombres": "...",
"N° Doc.": "DNI 12345678",
"N° Afiliación": "2-12345678",
"Tipo de Asegurado": "TITULAR",
"Estado": "ACTIVO",
"campo_8": "SUBSIDIADO (SIS GRATUITO)",
"campo_11": "25 / 07 / 2016",
"campo_13": "C.S. CENTRO DE SALUD",
"..."
}
]
}
Dependencias
Instaladas automáticamente:
- requests, beautifulsoup4, lxml
- opencv-python, Pillow, numpy
- onnxruntime (para OCR)
Licencia
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sis_scraper-1.0.8.tar.gz
(76.6 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sis_scraper-1.0.8.tar.gz.
File metadata
- Download URL: sis_scraper-1.0.8.tar.gz
- Upload date:
- Size: 76.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55a447337b83873a17239943f5a8fc96646df135b91c1023471875e498bb2203
|
|
| MD5 |
2d62b9527c3c62b20f1e2f93f0989c61
|
|
| BLAKE2b-256 |
54992a45b5cda4f2b4401a598e330a829ce736bccce3d8aa2ed87a1389eeeffa
|
File details
Details for the file sis_scraper-1.0.8-py3-none-any.whl.
File metadata
- Download URL: sis_scraper-1.0.8-py3-none-any.whl
- Upload date:
- Size: 76.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b53595aefb7da98736e85a1e8855fa891d2d9d1f4f60784790048ad21df7c74c
|
|
| MD5 |
f2d6e46c1252e98690db2b44cadf6e76
|
|
| BLAKE2b-256 |
30e1518822227eb67c6f3722c279178f9c66f21a1c18bbd8288dde94dcdf3baf
|