Shellnium is the selenium webdriver for Bash. You can exec selenium simply on your terminal.
#!/usr/bin/env bash
source ./selenium.sh
main() {
# Open the URL
navigate_to 'https://google.co.jp'
# Get the search box
local searchBox=$(find_element 'name' 'q')
# send keys
send_keys $searchBox "animal\n"
}
main
$ git clone [email protected]:Rasukarusan/shellnium.git
$ cd shellnium
$ sh demo.sh
# or
$ sh demo2.sh
You can add chrome options. e.g. --headless
.
$ sh demo.sh --headless --lang=es
demo2.sh
is required iTerm2 and MacOS.
This script is headless and display chromedriver's behavior as iTerm's background.
The above GIF is demo2.sh
.
- jq
The bash webdriver selenium.sh
is incomplete.
Here's what selenium.sh
can currently do
- delete session
- open url
- find element
- send keys
- click element
- take a screenshot
- exec javascript
https://qiita.com/Rasukarusan/items/70a54bd38c71a07ff7bd
MIT