nlpblogs commited on
Commit
2f151b0
·
verified ·
1 Parent(s): 67cb754

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -130,8 +130,8 @@ if st.button("Sentiment Analysis", type="secondary"):
130
 
131
  user_id = 1
132
  for comment in comments:
133
- timestamp = driver.find_elements(By.CSS_SELECTOR, 'div.author-info time')
134
- data.append({"User ID": user_id, "Comment": comment.text, "comment_date": timestamp.text})
135
  user_id += 1
136
  data = [dict(t) for t in {tuple(d.items()) for d in data}] # Remove duplicates
137
 
 
130
 
131
  user_id = 1
132
  for comment in comments:
133
+ timestamp = driver.find_element(By.XPATH, ".//div[contains(@class, 'author-info')]//time")
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}] # Remove duplicates
137