Advertisement
irokemr

estado usuario Steam

Apr 28th, 2021
1,238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3. import os
  4. from colorama import Fore, Back, Style, init
  5.  
  6.  
  7. init()
  8.  
  9.  
  10. UsuarioSteam = input("Escribe el nombre de steam: ")
  11. os.system('cls')
  12. URL = f'https://steamcommunity.com/id/{UsuarioSteam}'
  13.  
  14. page = requests.get(URL)
  15.  
  16. soup = BeautifulSoup(page.content, 'html.parser')
  17.  
  18. estado = soup.find('div', class_='profile_in_game_header').text
  19.  
  20.  
  21. estado = estado.replace('Currently Online',f"El usuario {Fore.YELLOW + UsuarioSteam}" + Fore.WHITE + " Está "+ Fore.GREEN +'En linea')
  22.  
  23.  
  24. estado = estado.replace('Currently Offline',  f"El usuario {Fore.YELLOW + UsuarioSteam}" + Fore.WHITE + " Está "+ Fore.RED + 'Desconectado')
  25. print(estado.replace('', ''))
  26.  
  27.  
  28. print(Fore.BLUE)
  29. os.system("pause")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement