title: Getting value after button click with BeautifulSoup Python
body: <p>I'm trying to get a value that is given by the website after a click on a button.</p>
  
  <p>Here is the website: <a href="https://www.4devs.com.br/gerador_de_cpf" rel="noreferrer">https://www.4devs.com.br/gerador_de_cpf</a></p>
  
  <p>You can see that there is a button called "Gerar CPF", this button provides a number that appears after the click.</p>
  
  <p>My current script opens the browser and get the value, but I'm getting the value from the page before the click, so the value is empty. I would like to know if it is possible to get the value after the click on the button.</p>
  
  <pre><code>from selenium import webdriver
  from bs4 import BeautifulSoup
  from requests import get
  
  url = "https://www.4devs.com.br/gerador_de_cpf"
  
  def open_browser():
      driver = webdriver.Chrome("/home/felipe/Downloads/chromedriver")
      driver.get(url)
      driver.find_element_by_id('bt_gerar_cpf').click()
  
  def get_cpf():
      response = get(url)
  
      page_with_cpf = BeautifulSoup(response.text, 'html.parser')
  
      cpf = page_with_cpf.find("div", {"id": "texto_cpf"}).text
  
      print("The value is: " + cpf)
  
  
  open_browser()
  get_cpf()
  </code></pre>