AIRider commited on
Commit
25cb68f
·
verified ·
1 Parent(s): 092b1b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -45,11 +45,10 @@ def get_blog_content(link):
45
  driver = webdriver.Chrome(options=options)
46
  driver.get(link)
47
  soup = BeautifulSoup(driver.page_source, "html.parser")
48
- title = soup.find("div", class_="se-module se-module-text se-title-text")
49
- if title:
50
- title = title.find("span").text.strip().replace("<!-- -->", "")
51
- else:
52
- title = "제목 없음"
53
  return title
54
 
55
  with gr.Interface(
 
45
  driver = webdriver.Chrome(options=options)
46
  driver.get(link)
47
  soup = BeautifulSoup(driver.page_source, "html.parser")
48
+ title = ""
49
+ for component in soup.find_all("div", class_="se-component se-text se-l-default"):
50
+ for paragraph in component.find_all("p", class_="se-text-paragraph"):
51
+ title += paragraph.text.strip() + "\n"
 
52
  return title
53
 
54
  with gr.Interface(