Beginner python, to summarize the problems encountered, if other beginners have encountered the same problem, can reference! From selenium import webdriverdriver=webdriver. Ie () driver.get (' https://www.baidu.com ') problem one:traceback (most recent call last): file "c:/python27/lib/test1.py", line 5, in <module> Driver=webdriver. Ie () File "C:\Python27\lib\site-packages\selenium\webdriver\ie\webdriver.py", line 55, in __init__ desired_capabilities=capabilities) File "c \ python27\lib\site-packages\selenium\webdriver\remote\webdriver.py ", line 90, in __init__ self.start_session (desired_capabilities, browser_profile) File "C : \python27\lib\site-packages\selenium\webdriver\remote\webdriver.py ", line 177, in start_ Session response = self.execute (command.new_session, capabilities) file "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute self.error_handler.check_response (response) File "c \ python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py ", line 194, in check_ Response raise exception_class (Message, screen, stacktrace) webdriverexception: message: unexpected error launching internet explorer. protected mode settings are not the same for all zones. enable protected mode must be set to the same value (Enabled or disabled) for all zones. problem Reason:the value of protected mode is inconsistentWorkaround:All mode must be set to the same, either to choose, or not to choose Question two:traceback (most recent call last): file "C:/Python27/Lib/ Test1.py ", line 5, in <module> driver=webdriver. Ie () File "C:\Python27\lib\site-packages\selenium\webdriver\ie\webdriver.py", line 55, in __init__ desired_capabilities=capabilities) File "c \ python27\lib\site-packages\selenium\webdriver\remote\webdriver.py ", line 90, in __init__ self.start_session (desired_capabilities, browser_profile) File "C : \python27\lib\site-packages\selenium\webdriver\remote\webdriver.py ", line 177, in start_ Session response = self.execute (command.new_session, capabilities) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute self.error_handler.check_response (response) File "C:\Python27\lib\site-packages\ selenium\webdriver\remote\errorhandler.py ", line 194, in check_response raise exception_class (Message, screen, stacktrace) webdriverexception: message: Unexpected error launching internet explorer. browser zoom level was set to 110%. It should be set to 100% cause of the problem:The browser is zoomed in.Workaround:set to 100% Problem three: >>> from selenium import webdriver>>> driver=webdriver. Firefox () Traceback (most recent call last): file "<pyshell#1>" , line 1, in <module> driver=webdriver. Firefox () File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 85, in __init__ keep_alive=true) File "C:\Python27\ lib\site-packages\selenium\webdriver\remote\webdriver.py ", line 90, in __init__ self.start_session (Desired_capabilities, browser_profile) File "c \ python27\lib\site-packages\selenium\webdriver\remote\webdriver.py ", line 177, in start_ Session response = self.execute (command.new_session, capabilities) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py ", line 234, in execute Response = self.command_executor.execute (Driver_command, params) File "c \ python27\lib\site-packages\selenium\webdriver\remote\remote_connection.py ", line 401, in Execute return self._request (Command_info[0], url, body=data) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 432, in _request resp = self._conn.getresponse () file "C:\Python27\lib\httplib.py", line 1045, in getresponse Response.begin () File "C:\Python27\lib\httplib.py", line 409, in begin version, status, reason = self._read_status () File "C:\Python27\lib\httplib.py", lIne 365, in _read_status line = self.fp.readline (_MAXLINE + 1) File "C:\Python27\lib\socket.py", line 476, in readline &NBSP;&NBSP;&NBSP;&NBSP;DATA&NBSP;=&NBSP;SELF._SOCK.RECV (self._rbufsize) Error: [errno 10054] an existing connection was forcibly closed by the remote host Cause of the problem:Firefox version is too new.Workaround:install an older version of the version, problem solved!
Beginner Python encounters a browser problem