Advertisement
Guest User

Untitled

a guest
Jan 26th, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.24 KB | None | 0 0
  1. import urllib.parse
  2. import urllib.request
  3. from urllib.request import Request, urlopen
  4. from urllib.error import URLError
  5.  
  6. url = 'http://www.kcchronicle.com/athlete-of-the-month/'
  7. headers = {'Connection' : 'keep-alive',
  8. 'Cache-Control' : 'max-age=0',
  9. 'Origin' : 'http://kcchronicle.com',
  10. 'Upgrade-Insecure-Requests' : '1',
  11. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',
  12. 'Content-type' : 'application/x-www-form-urlencoded',
  13. 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
  14. 'Referer' : 'http://kcchronicle.com/athlete-of-the-month/',
  15. 'Accept-Encoding' : 'gzip, deflate',
  16. 'Accept-Language' : 'en-US,en;q=0.8',
  17. 'Cookie' : 'aotm-logged-in=1; aotm-fb-connected=0; aotm-email=badesso1@gmail.com; fid=%7B%22iv%22%3A%22LHdCQLVj81B5d2GJy%2BEz5A%22%2C%22v%22%3A1%2C%22iter%22%3A1000%2C%22ks%22%3A128%2C%22ts%22%3A64%2C%22mode%22%3A%22ccm%22%2C%22adata%22%3A%22%22%2C%22cipher%22%3A%22aes%22%2C%22salt%22%3A%22sOaWjdKSBDk%22%2C%22ct%22%3A%22%2FxMmX2z0dHySknOzTjmZBfzmZEd0dVX9v00mg3ydT81us1NWEnG1dY2cWD2kU%2BRDnFIhsIsbD%2BWbUXEIJGfyNAd54fhp89Yw%2BJnZqn6uXfEsZP4JfkZvKw%22%7D'
  18. }
  19. values = {'vote' : '1',
  20. 'pollid' : '41',
  21. 'optionid' : '210' }
  22. data = urllib.parse.urlencode(values)
  23. data = data.encode('ascii')
  24. req = urllib.request.Request(url, data, headers)
  25. with urllib.request.urlopen(req) as response:
  26. the_page = response.read()
  27.  
  28. headers1 = {'Connection' : 'keep-alive',
  29. 'Cache-Control' : 'max-age=0',
  30. 'Origin' : 'http://kcchronicle.com',
  31. 'Upgrade-Insecure-Requests' : '1',
  32. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',
  33. 'Content-type' : 'application/x-www-form-urlencoded',
  34. 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
  35. 'Referer' : 'http://kcchronicle.com/athlete-of-the-month/',
  36. 'Accept-Encoding' : 'gzip, deflate',
  37. 'Accept-Language' : 'en-US,en;q=0.8',
  38. 'Cookie' : 'aotm-logged-in=1; aotm-fb-connected=0; aotm-email=bmx4l143@aol.com; fid=%7B%22iv%22%3A%22LHdCQLVj81B5d2GJy%2BEz5A%22%2C%22v%22%3A1%2C%22iter%22%3A1000%2C%22ks%22%3A128%2C%22ts%22%3A64%2C%22mode%22%3A%22ccm%22%2C%22adata%22%3A%22%22%2C%22cipher%22%3A%22aes%22%2C%22salt%22%3A%22sOaWjdKSBDk%22%2C%22ct%22%3A%22%2FxMmX2z0dHySknOzTjmZBfzmZEd0dVX9v00mg3ydT81us1NWEnG1dY2cWD2kU%2BRDnFIhsIsbD%2BWbUXEIJGfyNAd54fhp89Yw%2BJnZqn6uXfEsZP4JfkZvKw%22%7D'
  39. }
  40. req = urllib.request.Request(url, data, headers1)
  41. with urllib.request.urlopen(req) as response:
  42. the_page = response.read()
  43.  
  44. headers2 = {'Connection' : 'keep-alive',
  45. 'Cache-Control' : 'max-age=0',
  46. 'Origin' : 'http://kcchronicle.com',
  47. 'Upgrade-Insecure-Requests' : '1',
  48. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',
  49. 'Content-type' : 'application/x-www-form-urlencoded',
  50. 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
  51. 'Referer' : 'http://kcchronicle.com/athlete-of-the-month/',
  52. 'Accept-Encoding' : 'gzip, deflate',
  53. 'Accept-Language' : 'en-US,en;q=0.8',
  54. 'Cookie' : 'aotm-logged-in=1; aotm-fb-connected=0; aotm-email=iwonhitwonder@gmail.com; fid=%7B%22iv%22%3A%22lRnn4P66gy2LOXlefmZlbQ%22%2C%22v%22%3A1%2C%22iter%22%3A1000%2C%22ks%22%3A128%2C%22ts%22%3A64%2C%22mode%22%3A%22ccm%22%2C%22adata%22%3A%22%22%2C%22cipher%22%3A%22aes%22%2C%22salt%22%3A%229Kp7DIjU74Y%22%2C%22ct%22%3A%22s1bMvJIt%2FWuxgh0TsPPNt27L1aT0fS5GRFHB1cW4xCeFZXDYoXK2XyZwOPEArG9OdhR2YB3vri0r7kZKY2sXdwga62xbjnpTMTHLwPsYonDA1gIGDc7U4g%22%7D'
  55. }
  56. req = urllib.request.Request(url, data, headers2)
  57. with urllib.request.urlopen(req) as response:
  58. the_page = response.read()
  59.  
  60. headers3 = {'Connection' : 'keep-alive',
  61. 'Cache-Control' : 'max-age=0',
  62. 'Origin' : 'http://kcchronicle.com',
  63. 'Upgrade-Insecure-Requests' : '1',
  64. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',
  65. 'Content-type' : 'application/x-www-form-urlencoded',
  66. 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
  67. 'Referer' : 'http://kcchronicle.com/athlete-of-the-month/',
  68. 'Accept-Encoding' : 'gzip, deflate',
  69. 'Accept-Language' : 'en-US,en;q=0.8',
  70. 'Cookie' : 'aotm-logged-in=1; aotm-fb-connected=0; aotm-email=8008670@students.d303.org; fid=%7B%22iv%22%3A%22lRnn4P66gy2LOXlefmZlbQ%22%2C%22v%22%3A1%2C%22iter%22%3A1000%2C%22ks%22%3A128%2C%22ts%22%3A64%2C%22mode%22%3A%22ccm%22%2C%22adata%22%3A%22%22%2C%22cipher%22%3A%22aes%22%2C%22salt%22%3A%229Kp7DIjU74Y%22%2C%22ct%22%3A%22s1bMvJIt%2FWuxgh0TsPPNt27L1aT0fS5GRFHB1cW4xCeFZXDYoXK2XyZwOPEArG9OdhR2YB3vri0r7kZKY2sXdwga62xbjnpTMTHLwPsYonDA1gIGDc7U4g%22%7D'
  71. }
  72. req = urllib.request.Request(url, data, headers3)
  73. with urllib.request.urlopen(req) as response:
  74. the_page = response.read()
  75.  
  76. headers4 = {'Connection' : 'keep-alive',
  77. 'Cache-Control' : 'max-age=0',
  78. 'Origin' : 'http://kcchronicle.com',
  79. 'Upgrade-Insecure-Requests' : '1',
  80. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',
  81. 'Content-type' : 'application/x-www-form-urlencoded',
  82. 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
  83. 'Referer' : 'http://kcchronicle.com/athlete-of-the-month/',
  84. 'Accept-Encoding' : 'gzip, deflate',
  85. 'Accept-Language' : 'en-US,en;q=0.8',
  86. 'Cookie' : 'aotm-logged-in=1; aotm-fb-connected=0; aotm-email=fakename912@gmail.com; fid=%7B%22iv%22%3A%22lRnn4P66gy2LOXlefmZlbQ%22%2C%22v%22%3A1%2C%22iter%22%3A1000%2C%22ks%22%3A128%2C%22ts%22%3A64%2C%22mode%22%3A%22ccm%22%2C%22adata%22%3A%22%22%2C%22cipher%22%3A%22aes%22%2C%22salt%22%3A%229Kp7DIjU74Y%22%2C%22ct%22%3A%22s1bMvJIt%2FWuxgh0TsPPNt27L1aT0fS5GRFHB1cW4xCeFZXDYoXK2XyZwOPEArG9OdhR2YB3vri0r7kZKY2sXdwga62xbjnpTMTHLwPsYonDA1gIGDc7U4g%22%7D'
  87. }
  88. req = urllib.request.Request(url, data, headers4)
  89. with urllib.request.urlopen(req) as response:
  90. the_page = response.read()
  91.  
  92. headers5 = {'Connection' : 'keep-alive',
  93. 'Cache-Control' : 'max-age=0',
  94. 'Origin' : 'http://kcchronicle.com',
  95. 'Upgrade-Insecure-Requests' : '1',
  96. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',
  97. 'Content-type' : 'application/x-www-form-urlencoded',
  98. 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
  99. 'Referer' : 'http://kcchronicle.com/athlete-of-the-month/',
  100. 'Accept-Encoding' : 'gzip, deflate',
  101. 'Accept-Language' : 'en-US,en;q=0.8',
  102. 'Cookie' : 'aotm-logged-in=1; aotm-fb-connected=0; aotm-email=rivenhentai123@gmail.com; fid=%7B%22iv%22%3A%22lRnn4P66gy2LOXlefmZlbQ%22%2C%22v%22%3A1%2C%22iter%22%3A1000%2C%22ks%22%3A128%2C%22ts%22%3A64%2C%22mode%22%3A%22ccm%22%2C%22adata%22%3A%22%22%2C%22cipher%22%3A%22aes%22%2C%22salt%22%3A%229Kp7DIjU74Y%22%2C%22ct%22%3A%22s1bMvJIt%2FWuxgh0TsPPNt27L1aT0fS5GRFHB1cW4xCeFZXDYoXK2XyZwOPEArG9OdhR2YB3vri0r7kZKY2sXdwga62xbjnpTMTHLwPsYonDA1gIGDc7U4g%22%7D'
  103. }
  104. req = urllib.request.Request(url, data, headers5)
  105. with urllib.request.urlopen(req) as response:
  106. the_page = response.read()
  107.  
  108. headers6 = {'Connection' : 'keep-alive',
  109. 'Cache-Control' : 'max-age=0',
  110. 'Origin' : 'http://kcchronicle.com',
  111. 'Upgrade-Insecure-Requests' : '1',
  112. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',
  113. 'Content-type' : 'application/x-www-form-urlencoded',
  114. 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
  115. 'Referer' : 'http://kcchronicle.com/athlete-of-the-month/',
  116. 'Accept-Encoding' : 'gzip, deflate',
  117. 'Accept-Language' : 'en-US,en;q=0.8',
  118. 'Cookie' : 'aotm-logged-in=1; aotm-fb-connected=0; aotm-email=elliotisdumb1234@gmail.com; fid=%7B%22iv%22%3A%22lRnn4P66gy2LOXlefmZlbQ%22%2C%22v%22%3A1%2C%22iter%22%3A1000%2C%22ks%22%3A128%2C%22ts%22%3A64%2C%22mode%22%3A%22ccm%22%2C%22adata%22%3A%22%22%2C%22cipher%22%3A%22aes%22%2C%22salt%22%3A%229Kp7DIjU74Y%22%2C%22ct%22%3A%22s1bMvJIt%2FWuxgh0TsPPNt27L1aT0fS5GRFHB1cW4xCeFZXDYoXK2XyZwOPEArG9OdhR2YB3vri0r7kZKY2sXdwga62xbjnpTMTHLwPsYonDA1gIGDc7U4g%22%7D'
  119. }
  120. req = urllib.request.Request(url, data, headers6)
  121. with urllib.request.urlopen(req) as response:
  122. the_page = response.read()
  123.  
  124. headers7 = {'Connection' : 'keep-alive',
  125. 'Cache-Control' : 'max-age=0',
  126. 'Origin' : 'http://kcchronicle.com',
  127. 'Upgrade-Insecure-Requests' : '1',
  128. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',
  129. 'Content-type' : 'application/x-www-form-urlencoded',
  130. 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
  131. 'Referer' : 'http://kcchronicle.com/athlete-of-the-month/',
  132. 'Accept-Encoding' : 'gzip, deflate',
  133. 'Accept-Language' : 'en-US,en;q=0.8',
  134. 'Cookie' : 'aotm-logged-in=1; aotm-fb-connected=0; aotm-email=lisa063@hotmail.com; fid=%7B%22iv%22%3A%22lRnn4P66gy2LOXlefmZlbQ%22%2C%22v%22%3A1%2C%22iter%22%3A1000%2C%22ks%22%3A128%2C%22ts%22%3A64%2C%22mode%22%3A%22ccm%22%2C%22adata%22%3A%22%22%2C%22cipher%22%3A%22aes%22%2C%22salt%22%3A%229Kp7DIjU74Y%22%2C%22ct%22%3A%22s1bMvJIt%2FWuxgh0TsPPNt27L1aT0fS5GRFHB1cW4xCeFZXDYoXK2XyZwOPEArG9OdhR2YB3vri0r7kZKY2sXdwga62xbjnpTMTHLwPsYonDA1gIGDc7U4g%22%7D'
  135. }
  136. req = urllib.request.Request(url, data, headers7)
  137. with urllib.request.urlopen(req) as response:
  138. the_page = response.read()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement