title: Linkedin Post Scrape - Scrolling Down The Bollomless "Reaction" Popup (Python Selenium)
body: <p>Hope you are doing well. I'm writing a program using python and selenium with a simple task: to scrape all the info of people who react to a particular Linkedin post. So far it has worked, except I cant make the &quot;Reaction&quot; popup to scroll all the way down to capture all the info.</p>
  <p>Take this post for example: <a href="https://www.linkedin.com/posts/pcl-construction_simulation-vs-reality-measurement-and-verification-activity-6829434641338908672-229U" rel="nofollow noreferrer">https://www.linkedin.com/posts/pcl-construction_simulation-vs-reality-measurement-and-verification-activity-6829434641338908672-229U</a></p>
  <p>Here is the popup:
  <a href="https://i.stack.imgur.com/OTIp3.jpg" rel="nofollow noreferrer">Reactions</a></p>
  <p>So far I have only been able to scrape the info of the people who are in the view, and can't figure out a way to scroll that window down.</p>
  <p>Here is my code</p>
  <pre><code>from selenium import webdriver
  from webdriver_manager.chrome import ChromeDriverManager
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  
  #Wait for the popup to show
  pop_up_window = WebDriverWait(
      driver, 5).until(EC.element_to_be_clickable(
          (By.XPATH, &quot;/html/body/div[3]/div/div/div[2]&quot;)))
    
  # Scroll till list is there
  while True:
      driver.execute_script(
          'arguments[0].scrollTop = arguments[0].scrollTop + arguments[0].offsetHeight;', 
        pop_up_window)
      time.sleep(1)
  </code></pre>
  <p>I always get this error</p>
  <pre><code>selenium.common.exceptions.TimeoutException: Message:
  </code></pre>
  <p>There is nothing after &quot;Message&quot;, and after spending hours looking on the internet, I think this is because the script cannot find the popup element.</p>