Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,11 @@ import streamlit as st
|
|
5 |
def scrape_wikipedia(url):
|
6 |
response = requests.get(url)
|
7 |
soup = BeautifulSoup(response.content, 'html.parser')
|
8 |
-
|
|
|
|
|
|
|
|
|
9 |
return articles_list
|
10 |
|
11 |
def main():
|
|
|
5 |
def scrape_wikipedia(url):
|
6 |
response = requests.get(url)
|
7 |
soup = BeautifulSoup(response.content, 'html.parser')
|
8 |
+
div_element = soup.find('div', {'class': 'div-col columns column-width'})
|
9 |
+
if div_element is not None:
|
10 |
+
articles_list = div_element.find_all('li')
|
11 |
+
else:
|
12 |
+
articles_list = []
|
13 |
return articles_list
|
14 |
|
15 |
def main():
|