title: Why is Python requests returning a different text value to what I get when I navigate to the webpage by hand?
body: <p>I am trying to build a simple 'stock-checker' for a T-shirt I want to buy. Here is the link: <a href="https://yesfriends.co/products/mens-t-shirt-black?variant=40840532689069" rel="nofollow noreferrer">https://yesfriends.co/products/mens-t-shirt-black?variant=40840532689069</a></p>
  <p><a href="https://i.stack.imgur.com/usSJN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/usSJN.jpg" alt="t-shirt" /></a></p>
  <p>As you can see, I am present with 'Coming Soon' text, whereas usually if an item is in stock, it will show 'Add To Cart'.</p>
  <p>I thought the simplest way would be to use <code>requests</code> and <code>beautifulsoup</code> to isolate this <code>&lt;button&gt;</code> tag, and read the value of text. If it eventually says 'Add To Cart', then I will write the code to email/message myself it's back in stock.</p>
  <p><a href="https://i.stack.imgur.com/yHzY7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yHzY7.png" alt="chrome inspect" /></a></p>
  <p>However, here's the code I have so far, and you'll see that the response says the text contains 'Add To Cart', which is not what the website actually shows?</p>
  <pre class="lang-py prettyprint-override"><code>import requests
  import bs4
  
  URL = 'https://yesfriends.co/products/mens-t-shirt-black?variant=40840532689069'
  
  
  def check_stock(url):
  
      page = requests.get(url)
      soup = bs4.BeautifulSoup(page.content, &quot;html.parser&quot;)
      buttons = soup.find_all('button', {'name': 'add'})
  
      return buttons
  
  
  if __name__ == '__main__':
  
      buttons = check_stock(URL)
      print(buttons[0].text)
  </code></pre>