Closed victory-zz closed 3 months ago
Please add a valid Rod Version: v0.0.0
to your issue. Current version is v0.116.2
generated by check-issue
Restart your OS, or kill all chrome related processes, or use https://go-rod.github.io/#/custom-launch?id=remotely-manage-the-launcher
After running for a long time, the user data file will become larger. How to delete this file after browser.stop using os.removel? Regardless of whether os. chmod ("path", 0777) is executed or not, it will still report "assessment is denied"; When using exec to delete a folder, it cannot be deleted, and cmd. run() does not report an error
use os.removeall: err = os.chmod(userdatafile, 0777) if err != nil { log.Info("error infor:" + err.Error()) } err = os.RemoveAll(userdatafile) if err != nil { log.Info("error infor:" + err.Error()) }
use exec: //cmd := exec.Command("cmd", "/C", "rmdir", "/s", "/q", userdatafile) //err = cmd.Run() //if err != nil { // log.Info("error infor:" + err.Error()) //}