How to save web page result as file

Hey, I am new to katalon/selenium, wondering how I could save page source into file?

Thanks a lot

Tried and so far below code will do the job

WebDriver driver = DriverFactory.getWebDriver()

def myfile = new File(‘c:/myfile.html’)

myfile.write (driver.getPageSource())