Scraping Data in Javascript

Hello, I’m scraping a website that looks like this:

<script>

var message = "Hello";
var number = 123;

alert(message+number);
</script>

I’m looking to scrape the number variable and message variable, how can I do this in Python or PHP?

Im assuming using the raw HTML file.

Found a solution: