Skip to content

Instantly share code, notes, and snippets.

@tejainece
Last active January 20, 2022 13:51
Show Gist options
  • Save tejainece/6904e58edd0e3fe468805d798d1a85a1 to your computer and use it in GitHub Desktop.
Save tejainece/6904e58edd0e3fe468805d798d1a85a1 to your computer and use it in GitHub Desktop.
webdriver
curl 'http://localhost:9515/status'
# Create new headless session
curl -XPOST 'http://localhost:9515/session' -d '{"desiredCapabilities": {"browserName": "chrome", "goog:chromeOptions": {"args": ["--headless", "--no-sandbox"]}}}'
# Navigate to URL
curl -XPOST "http://localhost:9515/session/$1/url" -d '{"url": "https://google.com"}'
# Execute script
curl -XPOST http://localhost:9515/session/$1/execute/sync -d '{"script": "window.alert(\"Annoying\")", "args": []}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment