Update app.py
Browse files
app.py
CHANGED
@@ -124,13 +124,14 @@ if st.button("Sentiment Analysis", type="secondary"):
|
|
124 |
data = []
|
125 |
try:
|
126 |
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, "#contents #contents")))
|
127 |
-
|
|
|
|
|
128 |
|
129 |
-
comment_date_element = wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, 'div.author-info time')))
|
130 |
-
timestamp = comment_date_element.get_attribute('datetime')
|
131 |
user_id = 1
|
132 |
-
for
|
133 |
-
|
|
|
134 |
user_id += 1
|
135 |
data = [dict(t) for t in {tuple(d.items()) for d in data}] # Remove duplicates
|
136 |
|
|
|
124 |
data = []
|
125 |
try:
|
126 |
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, "#contents #contents")))
|
127 |
+
comments = driver.find_elements(By.CSS_SELECTOR, "#content #content-text")
|
128 |
+
|
129 |
+
|
130 |
|
|
|
|
|
131 |
user_id = 1
|
132 |
+
for comment in comments:
|
133 |
+
timestamp = driver.find_elements(By.CSS_SELECTOR, 'div.author-info time')
|
134 |
+
data.append({"User ID": user_id, "Comment": comment.text, "comment_date": timestamp})
|
135 |
user_id += 1
|
136 |
data = [dict(t) for t in {tuple(d.items()) for d in data}] # Remove duplicates
|
137 |
|