Advertisement
metalx1000

Post Form Submit with Python

Mar 17th, 2012
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import urllib
  4. import urllib2
  5.  
  6. url = 'https://docs.google.com/spreadsheet/formResponse?formkey=dEVSUzFBMk5mbG9qTjkwZUI5VEhvMEE6MQ'
  7.  
  8. user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
  9.  
  10. values = {
  11. # req_username, req_email, req_message
  12. # Guest name:, Guest e-mail:, Write message:
  13. 'entry.0.single' : 'Metalx1000',
  14. 'entry.1.single' : 'http://filmsbykris.com',
  15. }
  16. headers = { 'User-Agent' : user_agent }
  17.  
  18. data = urllib.urlencode(values)
  19. req = urllib2.Request(url, data)
  20. response = urllib2.urlopen(req)
  21. the_page = response.read()
  22.  
  23. print the_page
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement