title: How to tag Facebook Pages in post caption using Selenium?
body: <p>I am trying to write a script for that automatically shares Facebook posts to different Facebook groups(which are in a list).
  So here's the thing, <strong>I want to tag other pages in the caption via the script itself</strong></p>
  
  <p>Note: I've tried the way with 'ARROW_DOWN' and click on the suggested pages specific to those which are liked by the logged in user. And this way won't work for me because this script needs to be used by different users(and they've liked different pages, so they have different tag suggestions<a href="https://i.stack.imgur.com/1qN1I.png" rel="nofollow noreferrer">Click to see how pages are tagged usually</a>)</p>
  
  <p>P.S.: Just avoiding customised script for each user.</p>
  
  <p>Here's some code from the script that've made, the caption is entered via the CLI by the user as the string variable "caption_text" :</p>
  
  <pre><code>    for i in groups:
          try:
              self.driver.get(str(i))
              actions = ActionChains(self.driver)
              time.sleep(2)
              actions.send_keys('p').perform()
              time.sleep(1)
  
              actions2 = ActionChains(self.driver)
              actions2.send_keys(str(post_url) + " ").perform()
              time.sleep(3)
  
  
              actions4 = ActionChains(self.driver)
  
              for j in range(0, 15):
                  actions4.send_keys(Keys.BACK_SPACE).perform()
  
              caption = ActionChains(self.driver)
              caption.send_keys(caption_text).perform()
  
              click_post = self.driver.find_element_by_class_name("_332r")
              click_post.click()
              time.sleep(10)
              print "Successfully posted in " + str(i.split('https://www.facebook.com/groups/')[1].split('/')[0])
          except:
              print"Error posting in " + str(i.split('https://www.facebook.com/groups/')[1].split('/')[0])
  </code></pre>
  
  <p>Hope someone can help!
  Thanks :)</p>