title: the ways to track and click copy links on facebook using selenium
body: <p>I'm trying to scroll down the pages and track the 'share' button and click 'copy link'</p>
  <p>As you know, there are some posts that owns no copy link button in fb so in that case I'll skip</p>
  <pre><code>driver.get(f'https://www.facebook.com/hashtag/{tag_keyword}/')
  
      link_total_box = []
      scroll_cnt = 0
      
      last_height = driver.execute_script('return document.body.scrollHeight')
  
      while True:    
          
          scroll_cnt+=1 
          source = driver.page_source 
          html = BeautifulSoup(source, 'html.parser')
          post_div = html.find_all('div', attrs = {'class': 'rq0escxv l9j0dhe7 du4w35lb hpfvmrgz buofh1pr g5gj957u aov4n071 oi9244e8 bi6gxh9e h676nmdw aghb5jc5 gile2uim qmfd67dx'}) 
   
          
          try:
              post_div.find_element(By.CLASS_NAME, 'n00je7tq arfg74bv qs9ysxi8 k77z8yql i09qtzwb n7fi1qx3 b5wmifdl hzruof5a pmk7jnqg j9ispegn kr520xx4 c5ndavph art1omkt ot9fgl3s rnr61an3').click() # share_button
              time.sleep(2)
  
              post_div.find_element(By.CLASS_NAME, 'a8c37x1j ni8dbmo4 stjgntxs l9j0dhe7 ltmttdrg g0qnabr5').click() #copylink_button
              time.sleep(3)
  
              df = pd.DataFrame({
                  'links' : pyperclip.paste()
              })
  
              link_total_box.append(df)
              link_df = pd.concat(link_total_box)
              link_df.to_excel(f'{desktop_path}\\tag_{tag_keyword}_link.xlsx', index = False)
  
          except:
              pass
  </code></pre>
  <p>For some reason, it keeps failing to run function that I want. Can you give some advice on how to fix codes</p>
  <p>cheers</p>