Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -13,6 +13,15 @@ size_js="""
|
|
13 |
alert("Original width=" + realWidth + ", " + "Original height=" + realHeight);
|
14 |
}"""
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
def rev_im(image_url):
|
17 |
#image_url = 'https://i.pinimg.com/originals/c4/50/35/c450352ac6ea8645ead206721673e8fb.png'
|
18 |
out_list = []
|
@@ -53,9 +62,6 @@ def find_it(inp):
|
|
53 |
|
54 |
soup = BeautifulSoup(page_content, "html.parser")
|
55 |
print(soup.prettify())
|
56 |
-
#articles = soup.find_all("div", class_="SoaBEf")
|
57 |
-
#articles = soup.find_all("a")
|
58 |
-
#articles = soup.find_all("article", class_="MQsxIb xTewfe R7GTQ keNKEd j7vNaf Cc0Z5d VkAdve GU7x0c JMJvke q4atFc")
|
59 |
articles = soup.find_all("article")
|
60 |
out = soup.prettify
|
61 |
print (articles)
|
@@ -79,5 +85,6 @@ with gr.Blocks() as app:
|
|
79 |
with gr.Row():
|
80 |
|
81 |
html_out = gr.HTML("""""")
|
|
|
82 |
go_btn.click(rev_im,inp_url,[html_out])
|
83 |
app.launch()
|
|
|
13 |
alert("Original width=" + realWidth + ", " + "Original height=" + realHeight);
|
14 |
}"""
|
15 |
|
16 |
+
|
17 |
+
|
18 |
+
def process_files(files):
|
19 |
+
file_name = files.name
|
20 |
+
print file_name
|
21 |
+
return (file_name)
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
def rev_im(image_url):
|
26 |
#image_url = 'https://i.pinimg.com/originals/c4/50/35/c450352ac6ea8645ead206721673e8fb.png'
|
27 |
out_list = []
|
|
|
62 |
|
63 |
soup = BeautifulSoup(page_content, "html.parser")
|
64 |
print(soup.prettify())
|
|
|
|
|
|
|
65 |
articles = soup.find_all("article")
|
66 |
out = soup.prettify
|
67 |
print (articles)
|
|
|
85 |
with gr.Row():
|
86 |
|
87 |
html_out = gr.HTML("""""")
|
88 |
+
inp_im.change(process_files,inp_im,inp_url)
|
89 |
go_btn.click(rev_im,inp_url,[html_out])
|
90 |
app.launch()
|