import urllib.request
import re
import threading
import time
page = urllib.request.urlopen("http://blog.csdn.net/qq_35984195")
html = page.read()
html=html.decode('utf-8')
patt=r'http://blog.csdn.net/qq_35984195/article/details/\d{8}'
pattern = re.compile(patt)
list=re.findall(pattern,html)
print(list)
def target():
while True:
print ('the curent threading %s is running' % threading.current_thread().name)
for url in list:
print(url)
urllib.request.urlopen(url).read()
time.sleep(60)
print ('the curent threading %s is ended' % threading.current_thread().name)
t = threading.Thread(target=target)
t.start()
t.join()
import re
import threading
import time
page = urllib.request.urlopen("http://blog.csdn.net/qq_35984195")
html = page.read()
html=html.decode('utf-8')
patt=r'http://blog.csdn.net/qq_35984195/article/details/\d{8}'
pattern = re.compile(patt)
list=re.findall(pattern,html)
print(list)
def target():
while True:
print ('the curent threading %s is running' % threading.current_thread().name)
for url in list:
print(url)
urllib.request.urlopen(url).read()
time.sleep(60)
print ('the curent threading %s is ended' % threading.current_thread().name)
t = threading.Thread(target=target)
t.start()
t.join()