Using Selenium and BeautifulSoup. Saving the websites data to a file.
from selenium import webdriverfrom bs4 import BeautifulSoupurl ="https://google.com"browser = webdriver.Chrome('../drivers/chromedriver')browser.get(url)import time# allow page to loadtime.sleep(5)html = browser.page_source# passing html to Beautiful Soup parsersoup =BeautifulSoup(html, 'html.parser')# save scraped data (soup) to txt file, and output soup data to txt filewithopen('scraped.txt', 'w')as file:# save file as string file.write(str(soup))