nlpblogs commited on
Commit
5a885e4
·
verified ·
1 Parent(s): 5cca862

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -125,13 +125,15 @@ if st.button("Sentiment Analysis", type="secondary"):
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
- timestamp = driver.find_elements(By.CSS_SELECTOR, 'div.author-info time').text
129
  user_id = 1
130
  for comment in comments:
131
-
132
  data.append({"User ID": user_id, "Comment": comment.text, "comment_date": timestamp})
133
  user_id += 1
134
  data = [dict(t) for t in {tuple(d.items()) for d in data}]
 
 
135
  except Exception as e:
136
  st.error(f"Exception during comment extraction: {e}")
137
  driver.quit()
 
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
  user_id = 1
130
  for comment in comments:
131
+ timestamp = comment.find_element(By.CSS_SELECTOR, 'div.author-info time')
132
  data.append({"User ID": user_id, "Comment": comment.text, "comment_date": timestamp})
133
  user_id += 1
134
  data = [dict(t) for t in {tuple(d.items()) for d in data}]
135
+
136
+
137
  except Exception as e:
138
  st.error(f"Exception during comment extraction: {e}")
139
  driver.quit()