Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. ```python
  2. from bs4 import BeautifulSoup as soup
  3. from urllib.request import urlopen as ureq
  4. import time
  5.  
  6. #file = open("combos.txt", "r")
  7. #name = file.readlines()
  8. redo = []
  9. file = open("combos.txt", "r")
  10. name = file.readlines()
  11. for names in name:
  12. if " " in names:
  13. names = names.replace(" ", "+")
  14.  
  15. try:
  16. url = ("https://na.op.gg/summoner/userName="+names)
  17.  
  18. client = ureq(url)
  19. page_html = client.read()
  20. client.close()
  21.  
  22. page = soup(page_html, "html.parser")
  23. hhh = page.find("div", {"class": "TierRank"})
  24. bruh = hhh.text
  25. bruh = bruh.strip()
  26. names = names.strip()
  27.  
  28.  
  29. print (names.replace ("+", " "), bruh)
  30. with open ("output.txt", "a") as n:
  31. n.write(f"{names} {bruh}\n")
  32. time.sleep(0.5)
  33. continue
  34. except:
  35. redo.append(names)
  36. else:
  37. try:
  38. url = ("https://na.op.gg/summoner/userName="+names)
  39.  
  40. client = ureq(url)
  41. page_html = client.read()
  42. client.close()
  43.  
  44. page = soup(page_html, "html.parser")
  45. hhh = page.find("div", {"class": "TierRank"})
  46. bruh = hhh.text
  47. bruh = bruh.strip()
  48. names = names.strip()
  49.  
  50. print (names, bruh)
  51. with open ("output.txt", "a") as n:
  52. n.write(f"{names} {bruh}\n")
  53. time.sleep(0.5)
  54. continue
  55. except:
  56. redo.append(names)
  57. print ("Finished")
  58. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement