Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -9,11 +9,19 @@ def search_fn(query):
|
|
9 |
#links = soup.findAll("a")
|
10 |
|
11 |
links = soup.findAll("a")
|
|
|
12 |
for link in soup.find_all("a",href=re.compile("(?<=/url\?q=)(htt.*://.*)")):
|
13 |
out = (re.split(":(?=http)",link["href"].replace("/url?q=","").split("&sa",1)[0]))
|
14 |
out = out[0]
|
|
|
|
|
|
|
|
|
|
|
15 |
print (out)
|
16 |
-
|
|
|
|
|
17 |
|
18 |
|
19 |
def first():
|
@@ -39,11 +47,12 @@ with gr.Blocks() as app:
|
|
39 |
with gr.Row():
|
40 |
search_box=gr.Textbox("Search")
|
41 |
search_btn=gr.Button()
|
|
|
42 |
with gr.Row():
|
43 |
input = gr.Textbox()
|
44 |
btn = gr.Button()
|
45 |
output = gr.HTML("""""")
|
46 |
|
47 |
-
search_btn.click(search_fn,search_box,
|
48 |
btn.click(first,None,output).then(test,input,output)
|
49 |
app.launch()
|
|
|
9 |
#links = soup.findAll("a")
|
10 |
|
11 |
links = soup.findAll("a")
|
12 |
+
|
13 |
for link in soup.find_all("a",href=re.compile("(?<=/url\?q=)(htt.*://.*)")):
|
14 |
out = (re.split(":(?=http)",link["href"].replace("/url?q=","").split("&sa",1)[0]))
|
15 |
out = out[0]
|
16 |
+
|
17 |
+
frame_l=test(out)
|
18 |
+
with open("MyFile.txt", "w") as file:
|
19 |
+
file.writelines(frame_l)
|
20 |
+
|
21 |
print (out)
|
22 |
+
|
23 |
+
|
24 |
+
return (myfile.txt)
|
25 |
|
26 |
|
27 |
def first():
|
|
|
47 |
with gr.Row():
|
48 |
search_box=gr.Textbox("Search")
|
49 |
search_btn=gr.Button()
|
50 |
+
out_text = gr.Textbox()
|
51 |
with gr.Row():
|
52 |
input = gr.Textbox()
|
53 |
btn = gr.Button()
|
54 |
output = gr.HTML("""""")
|
55 |
|
56 |
+
search_btn.click(search_fn,search_box,out_text)
|
57 |
btn.click(first,None,output).then(test,input,output)
|
58 |
app.launch()
|