Selenium python、Java 清楚缓存方法

JAVA

    private void clearDriverCache(ChromeDriver driver) {
    driver.getDevTools().createSessionIfThereIsNotOne();
    driver.getDevTools().send(Network.clearBrowserCookies());
    // you could also use                
    // driver.getDevTools().send(Network.clearBrowserCache());
}

Python

driver.command_executor._commands['SEND_COMMAND'] = (
    'POST', '/session/$sessionId/chromium/send_command'
)

driver.execute('SEND_COMMAND', dict(cmd='Network.clearBrowserCache', params={}))

你可能感兴趣的:(python,java,selenium)