Hi Hansika, you can capture the source code of a webpage using following automation script:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from time import sleep
import io
driver = webdriver.Firefox()
driver.get("https://www.edureka.co")
elem = driver.find_element_by_xpath("//*")
source_code = elem.get_attribute("innerHTML")
filename = open(flipkart_page_source.html', 'w')
filename.write(source_code)
filename.close()
sleep(10)
driver.close()