InĀ [1]:
# Code attribution: Yiyin Shen, Tyler Caraza-Harter
# Imports
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
import time
import matplotlib.pyplot as plt
InĀ [2]:
# Take a screenshot of the page
service = Service(executable_path="chromedriver-win64/chromedriver.exe")
driver = webdriver.Chrome(service=service)
url = "https://pages.cs.wisc.edu/~yw/CS320F23L19.html"
driver.get(url)
time.sleep(1)
driver.save_screenshot("screen_chrome.png")
plt.imshow(plt.imread("screen_chrome.png"))
Out[2]:
<matplotlib.image.AxesImage at 0x19767ca9ad0>
InĀ [3]:
# Remember to quit when it's done
driver.quit()