I was trying to automate a website and it's a PWA. I need the caching data for this site as it takes too long to load, once loaded it's pretty fast. But every time I run my scripts chrome starts a new instance loading every resource from the beginning, how can I forcefully enable to use the cache or local storage data?
class ProductAdder:
def __init__(self):
self.url = 'https://testsite.com/'
self.driver = webdriver.Chrome(PATH)
self.driver.get(self.url)
def login(self):
wait = WebDriverWait(self.driver, 120)
wait.until(EC.presence_of_element_located((By.XPATH,"//input[@name='email']"))).send_keys('[email protected]')
wait.until(EC.presence_of_element_located((By.XPATH,"//input[@name='password']"))).send_keys('test')
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR,".MuiButton-label"))).click()
def add(self):
pass
if __name__ == '__main__':
selenium = ProductAdder()
selenium.login()