Update app.py
Browse files
app.py
CHANGED
@@ -124,14 +124,13 @@ 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 |
-
comments = driver.find_elements(By.CSS_SELECTOR, "#content #content-
|
128 |
|
129 |
user_id = 1
|
130 |
for comment in comments:
|
131 |
|
132 |
-
|
133 |
-
|
134 |
-
st.write(timestamp)
|
135 |
data.append({"User ID": user_id, "Comment": comment.text, "comment_date": timestamp})
|
136 |
user_id += 1
|
137 |
data = [dict(t) for t in {tuple(d.items()) for d in data}]
|
|
|
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-time")
|
128 |
|
129 |
user_id = 1
|
130 |
for comment in comments:
|
131 |
|
132 |
+
timestamp = datetime.now().strftime("%Y-%m-%d")
|
133 |
+
|
|
|
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}]
|