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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -12
app.py CHANGED
@@ -124,11 +124,12 @@ 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-name")
 
128
  user_id = 1
129
  for comment in comments:
130
- timestamp = datetime.now().strftime("%Y-%m-%d")
131
- data.append({"Comment": comment.text, "comment_date": timestamp})
132
  user_id += 1
133
  data = [dict(t) for t in {tuple(d.items()) for d in data}]
134
  except Exception as e:
@@ -181,12 +182,3 @@ if 'url_count' in st.session_state: #added if statement.
181
 
182
 
183
 
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192
-
 
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
+ 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:
 
182
 
183
 
184