Sha256: 8534e0756c43c0c0ba168f7d79da2fffd9efbd1f734443d119dc21d0a170b7c9
Contents?: true
Size: 772 Bytes
Versions: 10
Compression:
Stored size: 772 Bytes
Contents
#!/usr/bin/env ruby require "bundler/setup" require "browsed" require "launchy" require "yaml" url = "https://whatismyipaddress.com" screenshot = File.expand_path("../../files/#{Time.now.to_i}.png", __FILE__) path = File.join(File.dirname(__FILE__), "../proxies.yml") proxy = ::File.exists?(path) ? YAML.load_file(path).symbolize_keys : nil client = Browsed::Client.new( browser: :chrome, headless: true, device: :desktop, environment: :development, user_agent: :randomize, resolution: [1920,1080], options: {open_timeout: 30, read_timeout: 30}, proxy: proxy ) client.resize! # Set resolution client.session.visit(url) client.session.save_screenshot(screenshot) client.display_screenshot!(screenshot) client.quit!
Version data entries
10 entries across 10 versions & 1 rubygems