Advertisement
Guest User

Untitled

a guest
Aug 6th, 2018
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. from selenium import webdriver
  2. from selenium.webdriver.chrome.options import Options
  3. from selenium.common.exceptions import NoSuchElementException
  4. import winsound
  5. import bs4 as bs
  6. import urllib.request
  7. import time
  8. import os
  9. import sys
  10. import colorama
  11. from colorama import Fore, Back, Style
  12. colorama.init
  13.  
  14. chrome_options = Options()
  15. chrome_options.add_argument("--headless")
  16. chrome_options.add_argument("--window-size=600x600")
  17. driver = webdriver.Chrome(chrome_options=chrome_options)
  18. driver.get("http://steamcommunity.com/profiles/76561198447338200/edit")
  19. User = input("user: ")
  20. Pass = input("pass: ")
  21. frequency = 100
  22. duration = 1000
  23. requests2 = 0
  24.  
  25. driver.find_element_by_id("steamAccountName").send_keys(User)
  26. driver.find_element_by_id("steamPassword").send_keys(Pass)
  27. driver.find_element_by_id("SteamLogin").click()
  28. error = "Steam Community :: Error"
  29. for i in range(3, 0, -1):
  30. print("Logging in..." + "(" + str(i) + ")", end="\r", flush=True),
  31. time.sleep(1)
  32. try:
  33. logincheck = driver.find_element_by_id("customURL")
  34. if logincheck.is_displayed():
  35. print("Logged into " + User + " successfully.")
  36. ID = input("id to turbo: ")
  37. print(Style.RESET_ALL + "Now fishing for " + Fore.CYAN + ID + Style.RESET_ALL + "!")
  38. except NoSuchElementException:
  39. print(Fore.RED + "Login error!")
  40. sys.exit()
  41. driver.find_element_by_id("customURL").clear()
  42. while True:
  43. try:
  44. url = urllib.request.urlopen("http://steamcommunity.com/id/" + ID + "/videos")
  45. soup = bs.BeautifulSoup(url, 'lxml')
  46. availability = soup.title.string
  47. requests2 = requests2 + 1
  48. print(requests2, end='\r')
  49. if availability == error:
  50. driver.find_element_by_id("customURL").send_keys(ID)
  51. driver.find_element_by_id("customURL").send_keys(u'\ue007')
  52. customURLcheck = driver.find_element_by_id("customURL").get_attribute('value')
  53. if customURLcheck == ID:
  54. print(Fore.GREEN + "You fished " + ID + "!")
  55. winsound.Beep(frequency, duration)
  56. sys.exit()
  57. except urllib.error.HTTPError as e:
  58. if e.code == 503:
  59. print("Error code 503! Refreshing.")
  60. driver.refresh()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement