nlpblogs commited on
Commit
0a7152e
·
verified ·
1 Parent(s): 2e17dbc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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-text")
128
 
129
  user_id = 1
130
  for comment in comments:
131
 
132
- timestamp1 = driver.find_element(By.CSS_SELECTOR, 'div.author-info time')
133
- timestamp = timestamp1.get_attribute('datetime')
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}]