Spaces:
Runtime error
Runtime error
Commit
·
2fde56e
1
Parent(s):
5b382f2
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,11 +2,15 @@ import gradio as gr
|
|
| 2 |
import os
|
| 3 |
import requests
|
| 4 |
|
| 5 |
-
|
| 6 |
-
url = "https://www.mindat.org/"
|
|
|
|
|
|
|
|
|
|
| 7 |
def greet():
|
| 8 |
print("in greet")
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
with gr.Blocks() as iface:
|
| 12 |
btn = gr.Button("Run")
|
|
|
|
| 2 |
import os
|
| 3 |
import requests
|
| 4 |
|
| 5 |
+
url = "https://www.mindat.org/imagecache/46/9c/03220450016186848702713.jpg"
|
| 6 |
+
# url = "https://www.mindat.org/"
|
| 7 |
+
user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
|
| 8 |
+
headers = {'User-Agent': user_agent}
|
| 9 |
+
|
| 10 |
def greet():
|
| 11 |
print("in greet")
|
| 12 |
+
session = requests.Session()
|
| 13 |
+
print(session.get(url,headers = headers).content)
|
| 14 |
|
| 15 |
with gr.Blocks() as iface:
|
| 16 |
btn = gr.Button("Run")
|