from selenium import webdriver
import time
import os
driver = webdriver.Chrome()
url = 'https://www.qq.com'
driver.get(url)
time.sleep(2)
# 将浏览器所有进程杀掉,防止浏览器打开过多
returnCode=os.system('taskkill /F /iM chrome.exe')
returnCode=os.system('taskkill /F /iM iexplore.exe')
returnCode=os.system('taskkill /F /iM firefox.exe')
assert returnCode==0 #判断浏览器进程是否杀完
Python selenium automatically kills the browser process and kills the process
Guess you like
Origin blog.csdn.net/weixin_44123630/article/details/113836829
Recommended
Ranking