Created
June 6, 2022 09:00
-
-
Save dreygur/9a0b02714ad1cb279926e76bf33b9e13 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| uri = "http://localhost:3333/session" | |
| header = { | |
| "content-type": "application/json", | |
| } | |
| # Creates a new session | |
| res = requests.post(uri, json={ | |
| "capabilities": { | |
| "alwaysMatch": { | |
| "acceptInsecureCerts": True | |
| } | |
| } | |
| }, headers=header) | |
| # Stores Session ID | |
| seddionId = res.json().get("value").get("sessionId") | |
| # Browse to a URL | |
| requests.post(f"{uri}/{seddionId}/url", json={ | |
| "url": "https://www.google.com", | |
| }, headers=header) | |
| # Take a screenshot | |
| res = requests.get(f"{uri}/{seddionId}/screenshot", headers=header) | |
| print(res.json().get("value")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment