What is the method to extract data from a webpage that has dynamic content generated through JavaScript?

Hello, I am looking for help and advice on how to extract data from a webpage that has dynamic content generated through JavaScript, using Python. I am trying to scrape a webpage that has a table with dynamically loaded content that appears when the user clicks on a button. I have tried using traditional methods of web scraping, such as requests and beautifulsoup4, but they only retrieve the initial content of the webpage, without any of the dynamically loaded data.

I would be grateful for any suggestions, tips, or code examples on how to extract data from such webpages using Python. Specifically, I would like to learn how to simulate user interaction with buttons or other elements that trigger the dynamic content and then extract the data that is dynamically loaded.