Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ from requests.adapters import HTTPAdapter
|
|
5 |
from requests.packages.urllib3.util.retry import Retry
|
6 |
import re
|
7 |
from selenium import webdriver
|
|
|
8 |
|
9 |
def setup_session():
|
10 |
session = requests.Session()
|
@@ -42,6 +43,7 @@ def crawl_naver_search_results(url):
|
|
42 |
def get_blog_content(link):
|
43 |
options = webdriver.ChromeOptions()
|
44 |
options.add_argument("--disable-javascript")
|
|
|
45 |
driver = webdriver.Chrome(options=options)
|
46 |
driver.get(link)
|
47 |
soup = BeautifulSoup(driver.page_source, "html.parser")
|
@@ -67,4 +69,4 @@ with gr.Interface(
|
|
67 |
|
68 |
button.click(fn=get_blog_content_wrapper, inputs=text_input, outputs=text_output)
|
69 |
|
70 |
-
demo.launch()
|
|
|
5 |
from requests.packages.urllib3.util.retry import Retry
|
6 |
import re
|
7 |
from selenium import webdriver
|
8 |
+
import os
|
9 |
|
10 |
def setup_session():
|
11 |
session = requests.Session()
|
|
|
43 |
def get_blog_content(link):
|
44 |
options = webdriver.ChromeOptions()
|
45 |
options.add_argument("--disable-javascript")
|
46 |
+
os.environ["CHROMEDRIVER_PATH"] = "/usr/local/bin/chromedriver"
|
47 |
driver = webdriver.Chrome(options=options)
|
48 |
driver.get(link)
|
49 |
soup = BeautifulSoup(driver.page_source, "html.parser")
|
|
|
69 |
|
70 |
button.click(fn=get_blog_content_wrapper, inputs=text_input, outputs=text_output)
|
71 |
|
72 |
+
demo.launch(share=True)
|