Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```python
- from bs4 import BeautifulSoup as soup
- from urllib.request import urlopen as ureq
- import time
- #file = open("combos.txt", "r")
- #name = file.readlines()
- redo = []
- file = open("combos.txt", "r")
- name = file.readlines()
- for names in name:
- if " " in names:
- names = names.replace(" ", "+")
- try:
- url = ("https://na.op.gg/summoner/userName="+names)
- client = ureq(url)
- page_html = client.read()
- client.close()
- page = soup(page_html, "html.parser")
- hhh = page.find("div", {"class": "TierRank"})
- bruh = hhh.text
- bruh = bruh.strip()
- names = names.strip()
- print (names.replace ("+", " "), bruh)
- with open ("output.txt", "a") as n:
- n.write(f"{names} {bruh}\n")
- time.sleep(0.5)
- continue
- except:
- redo.append(names)
- else:
- try:
- url = ("https://na.op.gg/summoner/userName="+names)
- client = ureq(url)
- page_html = client.read()
- client.close()
- page = soup(page_html, "html.parser")
- hhh = page.find("div", {"class": "TierRank"})
- bruh = hhh.text
- bruh = bruh.strip()
- names = names.strip()
- print (names, bruh)
- with open ("output.txt", "a") as n:
- n.write(f"{names} {bruh}\n")
- time.sleep(0.5)
- continue
- except:
- redo.append(names)
- print ("Finished")
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement