Skip to content

Instantly share code, notes, and snippets.

@drnic
Created March 22, 2023 22:40
Show Gist options
  • Save drnic/284bc36a99ca879136e6e503fe79cc9d to your computer and use it in GitHub Desktop.
Save drnic/284bc36a99ca879136e6e503fe79cc9d to your computer and use it in GitHub Desktop.
require "playwright"
uri = "wss://chrome.browserless.io/playwright?token=#{browserless_api_key}"
Playwright.connect_to_playwright_server(uri) do |playwright|
playwright.chromium.launch do |browser|
page = browser.new_page
page.goto("https://github.com/YusukeIwaki")
page.screenshot(path: "./YusukeIwaki.png")
end
end
@AlexLoyola
Copy link

The playwright version could be the issue, make sure you install a supported playwright version, since playwright is tightly version coupled -> https://www.browserless.io/docs/versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment