Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,8 +10,9 @@ def scrape(instring):
|
|
| 10 |
#r = requests.get(instring)
|
| 11 |
chunk_size=2000
|
| 12 |
url = f'{instring}'
|
| 13 |
-
r = requests.get(url, stream=True)
|
| 14 |
-
|
|
|
|
| 15 |
with open('/tmp/metadata.pdf', 'wb') as fd:
|
| 16 |
for chunk in r.iter_content(chunk_size):
|
| 17 |
fd.write(chunk)
|
|
@@ -25,7 +26,7 @@ def scrape(instring):
|
|
| 25 |
|
| 26 |
#out = IFrame(src={instring}, width=700, height=600)
|
| 27 |
#return gr.HTML.update(f'''<iframe src={out}, width=700, height=600></iframe>''')
|
| 28 |
-
return gr.HTML.update(f'''{
|
| 29 |
|
| 30 |
with gr.Blocks() as app:
|
| 31 |
inp=gr.Textbox()
|
|
|
|
| 10 |
#r = requests.get(instring)
|
| 11 |
chunk_size=2000
|
| 12 |
url = f'{instring}'
|
| 13 |
+
#r = requests.get(url, stream=True)
|
| 14 |
+
html_content = requests.get(url).text
|
| 15 |
+
|
| 16 |
with open('/tmp/metadata.pdf', 'wb') as fd:
|
| 17 |
for chunk in r.iter_content(chunk_size):
|
| 18 |
fd.write(chunk)
|
|
|
|
| 26 |
|
| 27 |
#out = IFrame(src={instring}, width=700, height=600)
|
| 28 |
#return gr.HTML.update(f'''<iframe src={out}, width=700, height=600></iframe>''')
|
| 29 |
+
return gr.HTML.update(f'''{html_content}''')
|
| 30 |
|
| 31 |
with gr.Blocks() as app:
|
| 32 |
inp=gr.Textbox()
|