Update app.py
Browse files
app.py
CHANGED
@@ -125,9 +125,9 @@ if st.button("Sentiment Analysis", type="secondary"):
|
|
125 |
try:
|
126 |
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, "#contents #contents")))
|
127 |
comment_elements = driver.find_elements(By.CSS_SELECTOR, "#content #content-text")
|
128 |
-
comment_date_element = driver.find_element(By.XPATH, "//div[@class='author-info']//time")
|
129 |
|
130 |
-
|
|
|
131 |
user_id = 1
|
132 |
for comment_element in comment_elements: # Iterate through comment elements
|
133 |
data.append({"User ID": user_id, "Comment": comment_element.text, "comment_date": timestamp})
|
|
|
125 |
try:
|
126 |
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, "#contents #contents")))
|
127 |
comment_elements = driver.find_elements(By.CSS_SELECTOR, "#content #content-text")
|
|
|
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 comment_element in comment_elements: # Iterate through comment elements
|
133 |
data.append({"User ID": user_id, "Comment": comment_element.text, "comment_date": timestamp})
|