Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import urllib.request
|
|
|
|
| 3 |
def getHtml(url):
|
| 4 |
print(url)
|
| 5 |
-
html = urllib.request.urlopen(url).read()
|
| 6 |
return html
|
| 7 |
|
| 8 |
def saveHtml(file_name, file_content):
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import urllib.request
|
| 3 |
+
headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36'}
|
| 4 |
def getHtml(url):
|
| 5 |
print(url)
|
| 6 |
+
html = urllib.request.urlopen(url,headers).read()
|
| 7 |
return html
|
| 8 |
|
| 9 |
def saveHtml(file_name, file_content):
|