I am running a simple program written in python to launch a chrome incognito browser, navigate to a website, cast a vote (by clicking a radio button then clicking the vote button), then close the browser and repeat.
(我正在运行一个用python编写的简单程序,以启动chrome隐身浏览器,导航到网站,投票(通过单击单选按钮,然后单击“投票”按钮),然后关闭浏览器并重复。)
I am running this code: (我正在运行此代码:)
while 1>0:
page = webdriver.Chrome(options=options)
page.get(webpage)
#some code here
page.quit()
When i ran this code in PyCharm, it ran about ~50 times before it got EXTREMELY slow launching chrome.
(当我在PyCharm中运行此代码时,它运行了大约50次,然后才开始缓慢启动chrome。)
For instance, the first ~50 times it launched, it took 1-2 seconds to launch chrome and start loading the webpage. (例如,它首次启动约50次,启动chrome并开始加载网页需要1-2秒。)
But after ~50 times it started taking 20+ seconds to even launch chrome. (但是经过大约50次之后,它甚至开始花费20秒钟以上才能启动chrome。)
I had to completely restart pycharm to get this fixed and then it did it again after ~50 times. (我必须完全重新启动pycharm才能解决此问题,然后在?50次后再次执行。)
I thought this was an issue with pycharm so i ran it directly from the terminal (I am on mac).
(我认为这是pycharm的问题,所以我直接从终端运行了它(我在Mac上)。)
It ran about ~300 times from the terminal before it started doing the same thing. (在开始执行相同操作之前,它从终端运行了约300次。)
Any idea what is causing this or how i would fix it?
(任何想法是什么原因造成的或我将如何解决?)
Thanks
(谢谢)
ask by Lzypenguin translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…