Selenium无法停止加载

我想爬取某网页,该网页加载速度特别慢,所以设置超时时间强制加载
driver.set_page_load_timeout(3)
try:
driver.get('链接')
except TimeoutException:

driver.execute_script('window.stop()')#超时后停止加载

然后报错,后面的代码都无法执行了
报错信息如下
selenium.common.exceptions.TimeoutException: Message:Timeout

←如果以下回答对你有帮助,请点击右边的向上箭头及采纳下答案

from selenium import webdriver
d= webdriver.PhantomJS()
d.set_page_load_timeout(10)
d.set_script_timeout(10)#这两种设置都进行才有效

https://blog.csdn.net/ginynu/article/details/63697559

楼上这种方法也不能使用,爬取数量比较少的时候没事,但是大批量爬取还是会报错