Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,13 +15,17 @@ def search_fn(query):
|
|
| 15 |
out = (re.split(":(?=http)",link["href"].replace("/url?q=","").split("&sa",1)[0]))
|
| 16 |
out = out[0]
|
| 17 |
rr=requests.get(f"{out}")
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
| 22 |
|
| 23 |
#print(file1.read())
|
| 24 |
print (out)
|
|
|
|
|
|
|
| 25 |
file.close()
|
| 26 |
|
| 27 |
with open("myfile.txt", "r") as file1:
|
|
|
|
| 15 |
out = (re.split(":(?=http)",link["href"].replace("/url?q=","").split("&sa",1)[0]))
|
| 16 |
out = out[0]
|
| 17 |
rr=requests.get(f"{out}")
|
| 18 |
+
x_opt = (dict(rr.headers).get("x-frame-options"))
|
| 19 |
+
if x_opt == "None":
|
| 20 |
+
frame_l=f'<div class="container-mee"><div class="put-on-top"><a target="_blank" href="{out}">{out}</a></div><iframe class="responsive-iframe-mee" src="{out}" frameborder="3"></iframe></div>'
|
| 21 |
+
file.writelines(frame_l)
|
| 22 |
+
else:
|
| 23 |
+
pass
|
| 24 |
|
| 25 |
#print(file1.read())
|
| 26 |
print (out)
|
| 27 |
+
print(dict(rr.headers).get("x-frame-options"))
|
| 28 |
+
|
| 29 |
file.close()
|
| 30 |
|
| 31 |
with open("myfile.txt", "r") as file1:
|