crac

导航

sample function

#coding:utf8
import requests
import json
import ssl
import datetime
import urllib
import sys
import json
import time
import random
reload(sys)
sys.setdefaultencoding( "utf-8" )
ssl._create_default_https_context = ssl._create_unverified_context
requests.packages.urllib3.disable_warnings()  

def getall(html):
	#reg=r'<td>(.*?)</td>'
	html=html.replace('\n','').replace('\n\r','')
	reg=r'<tr class="">(.*?)</tr>'
	listre=re.compile(reg)
	mylist=re.findall(listre,html.strip())
	return mylist

  

posted on 2018-07-19 23:06  crac  阅读(286)  评论(0编辑  收藏  举报