Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
| 3 |
#import html5lib
|
| 4 |
#import copy
|
| 5 |
import requests
|
| 6 |
-
from IPython.display import IFrame
|
| 7 |
|
| 8 |
def scrape(instring):
|
| 9 |
|
|
@@ -12,7 +12,7 @@ def scrape(instring):
|
|
| 12 |
url = f'{instring}'
|
| 13 |
r = requests.get(url, stream=True)
|
| 14 |
html_content = requests.get(url).text
|
| 15 |
-
soup =
|
| 16 |
|
| 17 |
with open('/tmp/metadata.pdf', 'wb') as fd:
|
| 18 |
for chunk in r.iter_content(chunk_size):
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from bs4 import BeautifulSoup as bs
|
| 3 |
#import html5lib
|
| 4 |
#import copy
|
| 5 |
import requests
|
| 6 |
+
#from IPython.display import IFrame
|
| 7 |
|
| 8 |
def scrape(instring):
|
| 9 |
|
|
|
|
| 12 |
url = f'{instring}'
|
| 13 |
r = requests.get(url, stream=True)
|
| 14 |
html_content = requests.get(url).text
|
| 15 |
+
soup = bs(html_content,"html.parser")
|
| 16 |
|
| 17 |
with open('/tmp/metadata.pdf', 'wb') as fd:
|
| 18 |
for chunk in r.iter_content(chunk_size):
|