Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
魅族发货
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
# -*-coding: utf-8 -*- from urllib2 import urlopen import re page_count = 5 dest = u'厦门' url = 'http://event.meizu.com/pro_zmd-%d-%d.html' shipped = False regex = re.compile(u'<li>.*%s.*</li>' % dest) for i in range(1, page_count +1): data = urlopen(url % (1, i)).read().decode('utf-8') if regex.findall(data): shipped = True print('%s已经发货' % dest) if not shipped: print('尚未发货,请稍等!' )
[
+
]
Show input
Absolute running time: 9.35 sec, cpu time: 0.04 sec, memory peak: 8 Mb, absolute service time: 9.37 sec
edit mode
|
history
|
discussion