shows that the example of

can monitor Juhuasuan's snap up button. When Juhuasuan arrives at the time of the whole point, it sends a reminder (the audio file defines its own location) and automatically opens the page (URL defines itself).

can also customize the refresh interval time (default 0.1s) and monitor duration (default 1800s) through the command line parameters.

 encoding: UTF-8 source # '@author: Techzero @email: @time: 2014-5-18 import cStringIO import getopt at 5:06:29' import time import urllib2 import subprocess import sys from datetime import datetime MEDIA_PLAYER Files/Windows Media Player/wmplayer.exe'='C:/Program MEDIA_FILE ='D:/notify.mp3' CHROME ='C:/Program Files (x86) /Google/Chrome/Application/chrome.exe'URL =' Spm=608.2214381.2.1.SY0wVT& amp item_id=16761325430& id=10000002801432'; NO_X11 = False def (get_current_button): 'access to the current state of the button' content = urllib2.urlopen (URL).Read (buf) # access page content (conten = cStringIO.StringIO T.decode ('UTF-8').Encode ('utf8')) # page content into the input stream current_button = None for line in buf: line = line.strip (nr'') # removes newline (r'< a if line.find rel= "external nofollow >"; < /a> open group remind; ') = -1: current_button =' open! Remind the Group 'break (r'< elif line.find; div>')! = -1: current_button = 'break elif line.find' chance (r'< span> < /span> sold out...; ')! = -1: current_button =' break elif 'sold out line.find (r'< span> < /span> has ended...');! = -1: current_button = 'break elif line.find' has ended (r'< input type= "submit" title= "value=" immediately immediately grab "grab" /> -1: curren = ')! T_button = 'break' (buf.close) immediately grab return current_button def (notify): 'notice and open the page' subprocess.Popen Chrome seckill ([MEDIA_PLAYER, MEDIA_FILE]) if not NO_X11: subprocess.Popen ([CHROME, URL]) print 'def monitor_button' open page (interval, last): '' '' button to start monitoring elapse = 0 while elapse < last: current_button = get_current_button (now) = (print)'%d-%d-%d%d:%d:%d - Now button is%s'% (now.year, now.month,, now.hour, now.minute, now.second, current_button) if current_button = = or current_button = =' 'immediately grab' and 'print': the opportunity to panic buying! Notify (break elif current_button) '= =' sold out 'or current_button' = = 'has ended: print' try again! 'break else: print' hasn't started yet, and wait! 'time.sleep (interval) elapse (usage): def = interval print usage: [options] Options: -i' interval: by default. -l 30 seconds last: 1800 seconds by default. -h: Print this usage. -X: Run under no X11. 'if __name__'__main__': try: = = opts, args = getopt.getopt (sys.argv[1:],'i:l:hX') except getopt.GetoptError, err: print str (ERR) sys.exit (1) interval = 0.1 last = 1800 for opt, Val in opts: if opt = ='-i': interval = int (VAL) elif opt = ='-l': last = int (VAL) elif opt = ='-X': NO_X11 = True elif opt ='-h'(sys.exit: usage) (monitor_button (interval). Last) 

is higher than

It is the whole content of this article, I hope to help you, and hope that you can support a lot of scripting home.

This paper fixed link: | Script Home | +Copy Link

Article reprint please specify:Python to realize Taobao seconds to kill Juhuasuan snap up automatic reminder source code | Script Home

You may also be interested in these articles!