Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. import urllib
  2. import urllib2
  3. import webbrowser
  4.  
  5. url = 'https://fcq.colorado.edu/UCBdata.htm'
  6.  
  7. def main():
  8. data = urllib.urlencode({'subj': 'CSCI', 'crse': '1300'})
  9. results = urllib2.urlopen(url, data)
  10. print results.read()
  11. with open("results.html", "w") as f:
  12. f.write(results.read())
  13.  
  14. webbrowser.open("results.html")
  15. return 0
  16.  
  17. if __name__ == '__main__':
  18. main()
  19.  
  20. import requests
  21.  
  22. url = 'https://fcq.colorado.edu/UCBdata.htm'
  23.  
  24. def main():
  25. payload = {'subj': 'CSCI', 'crse': '1300'}
  26. r = requests.post(url, payload)
  27. with open("requests_results.html", "w") as f:
  28. f.write(r.content)
  29. return 0
  30.  
  31. if __name__ == '__main__':
  32. main()
  33.  
  34. import requests
  35.  
  36. url = 'https://fcq.colorado.edu/scripts/broker.exe'
  37.  
  38. payload = {
  39. "_PROGRAM": "fcqlib.fcqdata.sas",
  40. "_SERVICE": "fcq",
  41. "camp": "BD",
  42. "fileFrmt": "HTM",
  43. "ftrm": "1",
  44. "fyr": "2007",
  45. "grp1": "ALL",
  46. "jjj": "mytst",
  47. "ltrm": "7",
  48. "lyr": "2013",
  49. "sort": "descending YEARTERM SUBJECT COURSE SECTION",
  50. }
  51.  
  52. payload.update({
  53. 'subj': 'CSCI',
  54. 'crse': '1300',
  55. })
  56.  
  57.  
  58. def main():
  59. r = requests.post(url, payload)
  60. with open("requests_results.html", "w") as f:
  61. f.write(r.content)
  62. return 0
  63.  
  64. if __name__ == '__main__':
  65. main()
  66.  
  67. url = 'https://fcq.colorado.edu/UCBdata.htm'
  68.  
  69. url = 'https://fcq.colorado.edu/scripts/broker.exe'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement