RadicalTruthHF

Python

May 29th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.26 KB | None | 0 0
  1. import webbrowser
  2. import urllib2
  3.  
  4. login_user = raw_input('Please enter your username. ')
  5. login_pass = raw_input('Please enter your password. ')
  6. login_url  = 'http://www.hackforums.net/member.php?action=login'
  7. login_usock = urllib2.urlopen(login_url)
  8. login_data = login_usock.read()
  9. login_usock.close()
  10. login_html = login_data
  11. login_html = login_html.replace("<input type=\"text\" class=\"textbox\" name=\"username\" size=\"25\" maxlength=\"25\" style=\"width: 200px;\" value=\"\" />", "<input type=\"text\" class=\"textbox\" name=\"username\" size=\"25\" maxlength=\"25\" style=\"width: 200px;\" value=\"" + login_user + "\" />")
  12. login_html = login_html.replace("<input type=\"password\" class=\"textbox\" name=\"password\" size=\"25\" style=\"width: 200px;\" value=\"\" />", "<input type=\"password\" class=\"textbox\" name=\"password\" size=\"25\" style=\"width: 200px;\" value=\"" + login_pass + "\" />")
  13. print login_html
  14.  
  15.  
  16.  
  17. thread_id  = raw_input('Please enter the thread id, found in the url of the thread. ')
  18.  
  19. thread_url = 'http://www.hackforums.net/showthread.php?tid=' + thread_id
  20. thread_usock = urllib2.urlopen(thread_url)
  21. thread_data = thread_usock.read()
  22. thread_usock.close()
  23.  
  24. thread_html = thread_data
  25. print thread_html
  26. raw_input('Press ENTER to exit!')
Advertisement
Add Comment
Please, Sign In to add comment