12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- # -*- coding: utf-8 -*-
- # !/usr/bin/env python
- import os, sys,time,datetime
- import urllib
- import requests
- from mongoengine import register_connection, PointField, DynamicDocument, StringField
- import simplejson as json
- from django.db.models.fields import DateTimeField
- PROJECT_ROOT = os.path.join(os.path.abspath(os.path.split(os.path.realpath(__file__))[0] + "/.."), '..')
- sys.path.insert(0, PROJECT_ROOT)
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "configs.testing")
- from script.base import init_env
- init_env(interactive = False)
- from apps.web.core.db import Searchable
- import pyautogui
- # 首先输入访问设备的URL
- def send_url_for_dev(device_id):
- time.sleep(1)
- # x, y = pyautogui.position()
- # print x,y
- pyautogui.moveTo(1057,798)
- pyautogui.click()
- time.sleep(0.1)
- pyautogui.hotkey('ctrlleft', 'a')
- time.sleep(0.1)
- pyautogui.press('backspace')
- time.sleep(0.1)
- pyautogui.typewrite(message='http://hzchaotiankj.com/weixin/payone?num=%s' % device_id)
- time.sleep(0.1)
- pyautogui.hotkey('altleft', 's')
- time.sleep(0.1)
- pyautogui.moveTo(1112,630)
- pyautogui.click()
- time.sleep(5)
- pyautogui.moveTo(1260,129)
- time.sleep(0.2)
- pyautogui.click()
- # while True:
- # print pyautogui.position()
- # time.sleep(1)
- time.sleep(1)
- ii = 0
- while True:
- pyautogui.moveTo(987,574)
- file1 = pyautogui.screenshot(region=(766,220,412,575))
- file1.save(u'Q:/友商信息/汽车桩/星星充电/站列表截图/%s.png' % int(time.time()*1000))
- ii += 1
- print ii
- pyautogui.scroll(-400)
- time.sleep(0.2)
-
- print 'OK'
|