{"id":33944078,"url":"https://github.com/blacktrue/csf-sat-scraper","last_synced_at":"2026-01-13T19:18:52.395Z","repository":{"id":326984528,"uuid":"1107370946","full_name":"blacktrue/csf-sat-scraper","owner":"blacktrue","description":"A PHP library to scrape CSF PDFs from SAT Mexico website.","archived":false,"fork":false,"pushed_at":"2025-12-01T23:20:00.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-03T12:41:26.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blacktrue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-01T03:31:33.000Z","updated_at":"2025-12-01T23:20:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/blacktrue/csf-sat-scraper","commit_stats":null,"previous_names":["blacktrue/csf-sat-scraper"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/blacktrue/csf-sat-scraper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacktrue%2Fcsf-sat-scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacktrue%2Fcsf-sat-scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacktrue%2Fcsf-sat-scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacktrue%2Fcsf-sat-scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blacktrue","download_url":"https://codeload.github.com/blacktrue/csf-sat-scraper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacktrue%2Fcsf-sat-scraper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28397826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-12T17:03:18.382Z","updated_at":"2026-01-13T19:18:52.389Z","avatar_url":"https://github.com/blacktrue.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSF SAT Scraper\n\nUn scraper en PHP para descargar constancias de situación fiscal del SAT México.\n\n### Instalación\n\n```bash\ncomposer install blacktrue/csf-sat-scraper\n```\n\n### Uso Básico\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse Blacktrue\\CsfSatScraper\\Scraper;\nuse Blacktrue\\CsfSatScraper\\HttpClientFactory;\nuse PhpCfdi\\ImageCaptchaResolver\\Resolvers\\ConsoleResolver;\n\n$client = HttpClientFactory::create([\n    'curl' =\u003e [\n        CURLOPT_SSL_CIPHER_LIST =\u003e 'DEFAULT@SECLEVEL=1',\n    ],\n    RequestOptions::VERIFY =\u003e false,\n]);\n\n$captchaSolver = new ConsoleResolver();\n\n$scraper = new Scraper(\n    $client,\n    $captchaSolver,\n    'TU_RFC',\n    'TU_CONTRASEÑA'\n);\n\n$pdfContent = $scraper-\u003edownload();\nfile_put_contents('constancia.pdf', $pdfContent);\n```\n\n## 🧪 Testing\n\n### Ejecutar Tests\n\n```bash\n# Todos los tests\ncomposer test\n\n# Con formato legible\nvendor/bin/phpunit --testdox\n\n# Sin cobertura (más rápido)\nvendor/bin/phpunit --no-coverage\n\n# Test específico\nvendor/bin/phpunit tests/Unit/Services/CaptchaServiceTest.php\n```\n\n### Cobertura de Código\n\n```bash\ncomposer test-coverage\nopen coverage/index.html\n```\n\n## 🛠️ Desarrollo\n\n### Requisitos\n\n- PHP 8.4+\n- Composer\n- Extensión cURL\n\n### Dependencias Principales\n\n- `guzzlehttp/guzzle` - Cliente HTTP\n- `symfony/dom-crawler` - Parsing de HTML\n- `phpcfdi/image-captcha-resolver` - Resolución de captchas\n\n### Dependencias de Desarrollo\n\n- `phpunit/phpunit` ^10.0 - Framework de testing\n\n## 🔧 Servicios\n\n### AuthenticationService\n\nManeja todo el proceso de autenticación:\n- Inicialización de login\n- Obtención del formulario\n- Envío de credenciales\n- Verificación de sesión\n\n### CaptchaService\n\nResuelve el captcha del SAT:\n- Extracción de imagen del HTML\n- Resolución con el solver configurado\n\n### SSOHandler\n\nGestiona el flujo SSO/SAML:\n- Procesamiento de formularios SAML\n- Manejo de iframes\n- Redirecciones SSO\n\n### DocumentService\n\nDescarga el documento:\n- Envío de formulario final\n- Descarga del PDF\n\n## 🤝 Contribuir\n\n1. Fork el proyecto\n2. Crea una rama para tu feature (`git checkout -b feature/AmazingFeature`)\n3. Commit tus cambios (`git commit -m 'Add some AmazingFeature'`)\n4. Push a la rama (`git push origin feature/AmazingFeature`)\n5. Abre un Pull Request\n\n### Ejecutar Tests Antes de PR\n\n```bash\ncomposer test\n```\n\n## 📝 Licencia\n\nMIT License\n\n## 👤 Autor\n\nCesar Aguilera - cesargnu29@gmail.com\n\n## 🙏 Agradecimientos\n\n- PhpCfdi por image-captcha-resolver\n- Comunidad de PHP por las herramientas\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacktrue%2Fcsf-sat-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblacktrue%2Fcsf-sat-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacktrue%2Fcsf-sat-scraper/lists"}