djl234 commited on
Commit
2da44f3
·
1 Parent(s): 97e3e43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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):