Spaces:
Runtime error
Runtime error
File size: 832 Bytes
dfaeacc 5576d06 3242331 e16c43d 4542c8b cff4d64 3242331 c49bc9d 3242331 5576d06 3242331 5576d06 3242331 c49bc9d e16c43d dfaeacc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
from bs4 import BeautifulSoup
import requests
def ccs(inp,results):
inp1=inp.split(":")
if (inp1[0]=="https"):
response = requests.get(inp)
soup = BeautifulSoup(response.text, "html.parser")
result=response.text[response.text.find("viewCount"):].split('"')[2]
else:
if (len(inp1)==2):
if(inp1[0]=="End"):
result=result + " The " + inp1
else:
if (inp1[0]=="Start"):
result="Started" + "\n"
else:
try:
result=results+inp1[0] + " Picked " + inp1[1] + "\n"
except NameError:
result="Bad Format" #inp1[0] + " Picked " + inp1[1] + "\n"
else:
result="Wrong Format"
return result |