Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re,random,string
- N=7
- rnd=''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(N))
- print "rnd",rnd
- def postData(url, host, Referer):
- import requests
- import urllib2
- import re
- headers = {'Host': host,
- 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:62.0) Gecko/20100101 Firefox/62.0',
- 'Accept': '*/*',
- 'Accept-Language': 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3',
- 'Content-Type': 'application/x-www-form-urlencoded',
- 'Accept-Encoding' : 'deflate',
- 'X-Requested-With': 'XMLHttpRequest',
- 'Referer': Referer,
- 'Connection': 'keep-alive'}
- s = requests.Session()
- r = s.post(url, headers=headers, data=params)
- htmldata = r.content
- print params
- return htmldata
- url1='http://www.cccamlive.com/tests/takeatest/'
- referer1='http://www.cccamlive.com/tests/takeatest/'
- host1='www.cccamlive.com'
- data=postData(url1,host1,referer1)
- print data
- regx='''<div class='showline'>(.*?)
- </div>'''
- regx='''<div class='showline'>(.*?)<'''
- cline = re.findall(regx, data)[0]
- print "cline",cline
Advertisement
Add Comment
Please, Sign In to add comment