Spaces:
Runtime error
Runtime error
File size: 389 Bytes
a60b731 70b37e8 a60b731 70b37e8 a60b731 c885038 a60b731 c885038 a60b731 70b37e8 a60b731 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import gradio as gr
from bs4 import BeautifulSoup
import requests
def bcs(inp):
response = requests.get(inp) #, headers=HEADER)
soup = BeautifulSoup(response.text, "html.parser")
bcsresult=response.text[response.text.find("viewCount"):].split('"')[2]
return bcsresult #soup.prettify()
iface = gr.Interface(fn=bcs, inputs="text", outputs="text")
iface.launch() |