'Check whether a product is sold out by crawler

I would like to access whether the product is avaliable on this website(mouse product). By using the following code, I expected to get "Sold out". However, I always got "Add to Cart", probably because there is a script below according to the condition. How could I get "Sold out" in the situation? Thank you for your help.

    page = r.get("https://finalmouse.com/collections/museum/products/starlight-12-phantom?variant=39672355324040").content
    soup = bs(page, "html.parser")
    span = soup.find("span", {"id":"AddToCartText"})
    print(span.text)

website screen shot



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source