{"id":13587460,"url":"https://github.com/Rasukarusan/shellnium","last_synced_at":"2025-04-07T22:31:18.120Z","repository":{"id":37321297,"uuid":"275401879","full_name":"Rasukarusan/shellnium","owner":"Rasukarusan","description":":dizzy: Selenium Webdriver for Bash (or Zsh).","archived":false,"fork":false,"pushed_at":"2025-01-04T12:41:53.000Z","size":62,"stargazers_count":176,"open_issues_count":1,"forks_count":22,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-04T13:37:32.387Z","etag":null,"topics":["bash","headless-chrome","selenium","shell","zsh"],"latest_commit_sha":null,"homepage":"https://shellnium-site.vercel.app","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rasukarusan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-06-27T15:38:14.000Z","updated_at":"2025-01-04T12:41:10.000Z","dependencies_parsed_at":"2024-01-14T04:38:23.340Z","dependency_job_id":"aa288651-221c-4aeb-838f-8c6d8595ae32","html_url":"https://github.com/Rasukarusan/shellnium","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rasukarusan%2Fshellnium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rasukarusan%2Fshellnium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rasukarusan%2Fshellnium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rasukarusan%2Fshellnium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rasukarusan","download_url":"https://codeload.github.com/Rasukarusan/shellnium/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247740722,"owners_count":20988259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bash","headless-chrome","selenium","shell","zsh"],"created_at":"2024-08-01T15:06:13.337Z","updated_at":"2025-04-07T22:31:18.113Z","avatar_url":"https://github.com/Rasukarusan.png","language":"Shell","funding_links":[],"categories":["Shell","bash"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://shellnium-site.vercel.app/\" target=\"_blank\"\u003e\n    \u003cimg widht=\"500\" height=\"auto\" src=\"https://user-images.githubusercontent.com/17779386/112637471-8a785780-8e81-11eb-898f-c51e9deaba15.png\"\u003e\n  \u003c/a\u003e\n\u003cbr /\u003e\n\n\u003cimg alt=\"\" src=\"https://flat.badgen.net/github/stars/Rasukarusan/shellnium\"\u003e\n\u003ca aria-label=\"License\" href=\"https://github.com/Rasukarusan/shellnium/blob/master/LICENSE\"\u003e\n  \u003cimg alt=\"\" src=\"https://flat.badgen.net/github/license/Rasukarusan/shellnium\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n# Shellnium\n\nShellnium is the selenium WebDriver for Bash.  \nYou can exec selenium simply on your terminal.\n**All you need is Bash or Zsh.**  \n\n```sh\n#!/usr/bin/env bash\nsource ./selenium.sh\n\nmain() {\n    # Open the URL\n    navigate_to 'https://google.com'\n\n    # Get the search box\n    local searchBox=$(find_element 'name' 'q')\n\n    # send keys\n    send_keys $searchBox \"panda\\n\"\n}\n\nmain\n```\n\n\u003cimg src=\"https://shellnium-site.vercel.app/demo.gif\" width=\"700\" height=\"auto\"\u003e\n\n## Documentation\n\nhttps://shellnium-site.vercel.app\n\nIf you learn by watching videos, check out this screencast by [@gotbletu](https://github.com/gotbletu) to explore `shellnium` features.\n\n[![shellnium - Automate The Web Using Shell Scripts - Linux SHELL SCRIPT](https://img.youtube.com/vi/Q10dcPjmRTI/0.jpg)](https://www.youtube.com/watch?v=Q10dcPjmRTI)\n\n\n## Quick Start\n\n```bash\n# Run ChromeDriver before execute script\n$ chromedriver --port=9515\n\n# execute script\n$ sh demo.sh\n```\n\nYou can add chrome options. e.g. `--headless`.\n```sh\n$ sh demo.sh --headless --lang=es\n```\n\n**Make sure you have the right version of ChromeDriver and GoogleChrome.**\n```sh\n# Check the version of Google Chrome\n# ex. MacOS\n$ /Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --version\nGoogle Chrome 89.0.4389.82\n\n# Check the version of ChromeDriver\n$ chromedriver --version\nChromeDriver 89.0.4389.23 (61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/4389@{#294})\n```\n\nDownload chromedriver  \nhttps://chromedriver.chromium.org/downloads\n\n## Requirements\n\n- jq\n\n## Methods\n\nShellnium provides the following methods. See [document](https://shellnium-site.vercel.app) or [core.sh](https://github.com/Rasukarusan/shellnium/blob/master/lib/core.sh) for details.\n### Session\n\n- is_ready\n- new_session\n- delete_session\n- get_cookies\n- set_cookies\n- delete_cookies\n\n### Navigate\n\n- navigate_to\n- get_current_url\n- get_title\n- back\n- forward\n- refresh\n\n### Timeouts\n\n- get_timeouts\n- set_timeouts\n- set_timeout_script\n- set_timeout_pageLoad\n- set_timeout_implicit\n\n### Element Retrieval\n\n- find_element\n- find_elements\n- find_element_from_element\n- find_elements_from_element\n- get_active_element\n\n### Element State\n\n- get_attribute\n- get_property\n- get_css_value\n- get_text\n- get_tag_name\n- get_rect\n- is_element_enabled\n\n### Element Interaction\n\n- send_keys\n- click\n- element_clear\n\n### Document\n\n- get_source\n- exec_script\n- element_screenshot\n- screenshot\n\n### Cookies\n\n- get_all_cookies\n- get_named_cookie\n- add_cookie\n- delete_cookie\n- delete_all_cookies\n\n### Context\n\n- get_window_handle\n- get_window_handles\n- delete_window\n- new_window\n- switch_to_window\n- switch_to_frame\n- switch_to_parent_frame\n- get_window_rect\n- set_window_rect\n- maximize_window\n- minimize_window\n- fullscreen_window\n\n## Article\n\nEnglish\nhttps://dev.to/rasukarusan/shellnium-simple-selnium-webdriver-for-bash-1a9k\n\nJapanese\nhttps://qiita.com/Rasukarusan/items/70a54bd38c71a07ff7bd\n\n## Example\n\n\u003cimg src=\"https://shellnium-site.vercel.app/demo2.gif\" width=\"700\" height=\"auto\"\u003e\n\n```sh\n$ sh demo2.sh\n```\n`demo2.sh` is required iTerm2 and Mac OS.\n\nThis script is headless and display chromedriver's behavior as iTerm's background with AppleScript.\n\n## Reference\n\n- [WebDriver](https://www.w3.org/TR/webdriver/)\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRasukarusan%2Fshellnium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRasukarusan%2Fshellnium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRasukarusan%2Fshellnium/lists"}