[英]Error in python selenium webdriver chrome
I have the following errors when using the selenium webdriver.chrome in Windows.在 Windows 中使用 selenium webdriver.chrome 时出现以下错误。 I am using Windows 10 Home 64 bit and python verison Python 3.8.3 64-bit.
我正在使用 Windows 10 Home 64 位和 python 版本 Python 3.8.3 64 位。 I have tried all solutions I could search but cannot solve it.
我已经尝试了所有可以搜索但无法解决的解决方案。
The following is the error message:以下是错误信息:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\clive\anaconda3\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 68, in __init__
self.service = Service(
File "C:\Users\clive\anaconda3\lib\site-packages\selenium\webdriver\chrome\service.py", line 41, in __init__
service.Service.__init__(self, executable_path, port=port, env=env,
File "C:\Users\clive\anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 42, in __init__
self.port = utils.free_port()
File "C:\Users\clive\anaconda3\lib\site-packages\selenium\webdriver\common\utils.py", line 37, in free_port
free_socket.listen(5)
OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions
This is the code这是代码
>>> from selenium import webdriver
>>> driver = webdriver.Chrome(executable_path = 'C:\\Users\\clive\\code\\chromedriver_win32\\chromedriver.exe')
Error message came out after the second line of the code is run.运行第二行代码后出现错误消息。
I appreciate your help on this.感谢您在这方面的帮助。
Sometimes it happens due to firewall.有时由于防火墙而发生。 Can you turn off the firewall and then check again.
能不能把防火墙关掉再检查一下。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.