fork(1) download
  1. #! /usr/bin/env python
  2. #coding=utf-8
  3.  
  4. import requests, json
  5.  
  6. database = ["06_cn_mumayi_jd_com",
  7. "1010wan_beihaiw_duowan",
  8. "12306_cn",
  9. "131_xiu_tianya",
  10. "17173_com",
  11. "212300_cxhr_zhaopin_com",
  12. "212300_cxhr_zhaopin_copy",
  13. "24buy_cd",
  14. "51cto_com_new",
  15. "51job_com",
  16. "52pk_com",
  17. "55_la",
  18. "766_tuan800_wanmei_37",
  19. "7k7k_com",
  20. "admin5_apphan_07073_soyun",
  21. "aipai_com",
  22. "all_hack_website",
  23. "av_creditcard_com_cn",
  24. "ccidnet_lashou_com",
  25. "cnnb_mop_qinbao_jiapin_qd315",
  26. "cnzz_com",
  27. "co188_com",
  28. "csdn_net",
  29. "damai_cn",
  30. "dangdang_com",
  31. "dodonew_com",
  32. "gfan_com",
  33. "hiapk_com",
  34. "houdao_com",
  35. "ipart_cn",
  36. "jxjatv_073yx_moko_treo8_paojiao",
  37. "jxrsrc_zhenai",
  38. "kaixin001_com-ispeak_com",
  39. "mail_126_com",
  40. "mail_163_com",
  41. "mail_qq_sina",
  42. "mail_qq_sohu",
  43. "pconline_com_cn",
  44. "pingan_com",
  45. "qiannao_dedecms_baofeng",
  46. "qq_old_password",
  47. "radius-qingdaonews_com",
  48. "renren_com",
  49. "seowhy_shooter-tatazu_book118_cs",
  50. "sorry_unknown",
  51. "sorry_unknown2",
  52. "tgbus_com",
  53. "tpy100_com-jia_com",
  54. "uuu9_com",
  55. "weibo_com",
  56. "xda_comicdd_game",
  57. "xiaohua_other",
  58. "xiaomi_com"
  59. ]
  60.  
  61.  
  62. class HxSec():
  63. def __init__(self):
  64. self.s = requests.session()
  65. r = self.s.get('http://c...content-available-to-author-only...c.com/')
  66.  
  67. def searchsafe(self, url, payload, headers):
  68. for i in range(0, 10):
  69. try:
  70. r = self.s.post(url, data = payload, headers = headers)
  71. info = r.content
  72. return info
  73.  
  74. except Exception as e:
  75. print e, payload
  76. return None
  77.  
  78. '''
  79. type: 1 名字邮箱, 2 名字, 3 邮箱
  80. method: 1 模糊, 2 精确
  81. 返回元组或者None
  82. '''
  83. def search1(self, type, method, key, table):
  84. url = 'http://c...content-available-to-author-only...c.com/ajax.php?act=select'
  85. headers = {'X-Requested-With': 'XMLHttpRequest'}
  86. payload = {'select_act':type,
  87. 'match_act':method,
  88. 'key':key,
  89. 'table':table
  90. }
  91. info = self.searchsafe(url, payload, headers)
  92. p = info.find('addRow(')
  93. if p == -1:
  94. return None
  95.  
  96. # 可能多行addRow(
  97. info = info[p:]
  98. info = info.split('addRow(')
  99. if len(info) <= 1:
  100. return None
  101.  
  102. k1 = []
  103. for i in range(1, len(info)):
  104. info1 = info[i]
  105. info1 = info1[:-2]
  106. info1 = info1.split(',')
  107. k = []
  108. for i in info1:
  109. k.append(i[1:-1])
  110. k1.append(k)
  111. return k1
  112.  
  113. def search(self, type, method, key):
  114. r1 = []
  115. for i in database:
  116. r = self.search1(type, method, key, i)
  117. if r != None:
  118. for r0 in r:
  119. r1.append(r0)
  120. return r1
  121.  
  122. if __name__ == '__main__':
  123. hs = HxSec()
  124. r = hs.search(1, 2, 'fish13')
  125. print r# your code goes here
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 125, in compile
    _optimize=optimize)
  File "<frozen importlib._bootstrap_external>", line 735, in source_to_code
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "./prog.py", line 75
    print e, payload
          ^
SyntaxError: Missing parentheses in call to 'print'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.5/py_compile.py", line 129, in compile
    raise py_exc
py_compile.PyCompileError:   File "./prog.py", line 75
    print e, payload
          ^
SyntaxError: Missing parentheses in call to 'print'

stdout
Standard output is empty