Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions sniper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import colorama

from pick import pick
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException, NoSuchElementException, WebDriverException
Expand All @@ -21,6 +23,7 @@

from pathlib import Path
from time import sleep
from sys import platform

import sniper.api as api
import sniper.checkout as checkout
Expand Down Expand Up @@ -80,6 +83,20 @@ async def main():
notification_config, customer = read_config()

driver = webdriver.create()

ctrl_cmd = None
if platform == 'darwin':
ctrl_cmd = Keys.COMMAND
else:
ctrl_cmd = Keys.CONTROL
driver.get('https://google.com')
actions = ActionChains(driver)
about = driver.find_element_by_class_name('MV3Tnb')
actions.key_down(ctrl_cmd).click(about).key_up(ctrl_cmd).perform()
driver.switch_to.window(driver.window_handles[-1])
driver.get("https://gmail.com")
driver.switch_to.window(driver.window_handles[0])

user_agent = driver.execute_script('return navigator.userAgent;')

gpu_data = read_json(data_path / 'gpus.json')
Expand Down