# coding=utf-8
from selenium import webdriver
from selenium.webdriver.common.keys import Keys #引入按键包
import os
import random
import codecs
import time
from ctypes import * # 获取屏幕上某个坐标的颜色
#chromedriver = "C:/Program Files (x86)/Google/Chrome/Application/chromedriver"
#os.environ["webdriver.chrome.driver"] = chromedriver
#driver = webdriver.Chrome(chromedriver) #模拟打开浏览器
#driver.get("http://1314916.com/") #打开网址
#driver.maximize_window() #窗口最大化
#
time.sleep(random.randint(2,10))
gdi32 = windll.gdi32
user32 = windll.user32##获取句柄
hdc = user32.GetDC(None)#获取指定像素的颜色
c = gdi32.GetPixel(hdc,100,50)
print(hex(c)) ##打印十进制转化为十六进制的颜色