mino60

Untitled

Apr 2nd, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.13 KB | None | 0 0
  1. import re,random,string
  2. N=7
  3. rnd=''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(N))
  4. print "rnd",rnd
  5.  
  6. def postData(url, host, Referer):
  7.     import requests
  8.     import urllib2
  9.     import re
  10.     headers = {'Host': host,
  11.      'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:62.0) Gecko/20100101 Firefox/62.0',
  12.      'Accept': '*/*',
  13.      'Accept-Language': 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3',
  14.      'Content-Type': 'application/x-www-form-urlencoded',
  15.      'Accept-Encoding' : 'deflate',
  16.      'X-Requested-With': 'XMLHttpRequest',
  17.      'Referer': Referer,
  18.      'Connection': 'keep-alive'}
  19.     params={"idreferrer":'0','email':'%[email protected]'%rnd}
  20.     s = requests.Session()
  21.     r = s.post(url, headers=headers, data=params)
  22.     htmldata = r.content
  23.     print params
  24.     return htmldata
  25. url1='http://www.cccamlive.com/tests/takeatest/'
  26. referer1='http://www.cccamlive.com/tests/takeatest/'
  27. host1='www.cccamlive.com'
  28.  
  29. data=postData(url1,host1,referer1)
  30. print data
  31. regx='''<div class='showline'>(.*?)
  32. </div>'''
  33. regx='''<div class='showline'>(.*?)<'''
  34. cline = re.findall(regx, data)[0]
  35.  
  36. print "cline",cline
Advertisement
Add Comment
Please, Sign In to add comment