{"id":51075344,"url":"https://github.com/codestorm-official/selenium-flask","last_synced_at":"2026-06-23T13:41:15.739Z","repository":{"id":340162667,"uuid":"1111517172","full_name":"codestorm-official/selenium-flask","owner":"codestorm-official","description":"A compact starter for running Selenium-powered web scraping with Flask. Includes headless Chromium setup, ChromeDriver integration, and a simple example route. An easy base for browser automation, data extraction, or lightweight scraping services.","archived":false,"fork":false,"pushed_at":"2026-06-13T07:10:42.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-13T08:16:19.237Z","etag":null,"topics":["flask","flask-automation","scraping","selenium-python"],"latest_commit_sha":null,"homepage":"https://railway.com/deploy/selenium-flask","language":"Python","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/codestorm-official.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-07T05:03:43.000Z","updated_at":"2026-06-13T07:10:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/codestorm-official/selenium-flask","commit_stats":null,"previous_names":["codestorm-official/selenium-flask"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codestorm-official/selenium-flask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fselenium-flask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fselenium-flask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fselenium-flask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fselenium-flask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codestorm-official","download_url":"https://codeload.github.com/codestorm-official/selenium-flask/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codestorm-official%2Fselenium-flask/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34692768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["flask","flask-automation","scraping","selenium-python"],"created_at":"2026-06-23T13:41:14.949Z","updated_at":"2026-06-23T13:41:15.731Z","avatar_url":"https://github.com/codestorm-official.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Selenium Flask\n\nDeploy an independent Flask scraper on Railway with Selenium running as a separate browser service.\n\n[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/selenium-flask?referralCode=asepsp\u0026utm_medium=integration\u0026utm_source=template\u0026utm_campaign=generic)\n\n## Architecture\n\nThis template is designed for 2 Railway services in the same project:\n\n| Service | Source | Purpose |\n| ------- | ------ | ------- |\n| `api` | This repository | Independent Flask app and scraper routes |\n| `selenium` | `selenium/standalone-chrome` | Independent Remote Chrome browser service |\n\nThe Flask service connects to Chrome through Remote WebDriver:\n\n```python\ndriver = webdriver.Remote(\n    command_executor=SELENIUM_URL,\n    options=options,\n)\n```\n\n## Railway Setup\n\n1. Deploy this repository as the Flask service.\n2. Add another service from Docker image:\n\n   ```text\n   selenium/standalone-chrome\n   ```\n\n3. Name the browser service `selenium`.\n4. Set the Flask service variables from `.env.example`.\n\nThe required Selenium connection value is:\n\n```text\nSELENIUM_URL=http://selenium.railway.internal:4444/wd/hub\n```\n\nRailway private networking lets services in the same project communicate with\n`SERVICE_NAME.railway.internal`, so the Selenium service does not need to be\npublicly exposed.\n\n## Environment Variables\n\nCopy `.env.example` to `.env` for local development. On Railway, add the same\nvalues in the Flask service Variables tab.\n\n| Variable | Default | Description |\n| -------- | ------- | ----------- |\n| `PORT` | `8000` | HTTP port used by Gunicorn |\n| `SELENIUM_URL` | `http://selenium.railway.internal:4444/wd/hub` | Selenium Remote WebDriver URL |\n| `SCRAPE_URL` | `https://www.scrapethissite.com/` | URL loaded by the example scraper |\n| `LOG_LEVEL` | `INFO` | Application log level |\n| `GUNICORN_HOST` | `0.0.0.0` | Host used when `GUNICORN_BIND` is empty |\n| `GUNICORN_BIND` | empty | Optional full bind override, for example `0.0.0.0:8000` |\n| `GUNICORN_WORKERS` | `2` | Number of Gunicorn workers |\n| `GUNICORN_WORKER_CLASS` | `sync` | Gunicorn worker class for Flask |\n| `GUNICORN_TIMEOUT` | `120` | Worker timeout in seconds |\n| `GUNICORN_KEEPALIVE` | `5` | Keep-alive timeout in seconds |\n| `GUNICORN_LOG_LEVEL` | `info` | Gunicorn log level |\n| `GUNICORN_ACCESS_LOG` | `-` | Access log target |\n| `GUNICORN_ERROR_LOG` | `-` | Error log target |\n\n## Endpoints\n\n| Route | Description |\n| ----- | ----------- |\n| `/` | Basic status check and scrape test endpoint hint |\n| `/scrape` | Example scraper using the remote Selenium Chrome service |\n\n## Local Development\n\nCreate a local env file:\n\n```bash\ncp .env.example .env\n```\n\nRun the Flask service independently:\n\n```bash\npip install -r requirements.txt\ngunicorn -c settings.py main:app\n```\n\nThe Selenium browser must be reachable at `SELENIUM_URL`. For Railway, use the\nprivate service URL. For another local or external Selenium service, update\n`SELENIUM_URL` in `.env`.\n\nThen open:\n\n```text\nhttp://localhost:8000/scrape\n```\n\n## File Structure\n\n```text\n.\n├── .env.example\n├── Dockerfile\n├── settings.py\n├── main.py\n└── requirements.txt\n```\n\n## Notes\n\n* The Flask image does not install Chromium or Chromedriver.\n* Browser automation runs inside `selenium/standalone-chrome`.\n* Gunicorn serves the Flask app through `main:app`.\n* Add request throttling, queues, or worker separation if scrape workloads become heavy.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodestorm-official%2Fselenium-flask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodestorm-official%2Fselenium-flask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodestorm-official%2Fselenium-flask/lists"}