0
When trying to execute a code using the Selenium library, I get the following error:
<html><head></head><body></body></html>
Traceback (most recent call last):
File "webdriver.py", line 23, in <module>
driver.set_window_size(1234, 773)
File "/home/lucas/.local/lib/python2.7/sitepackages/selenium/webdriver/remote/webdriver.py", line 1090, in set_window_size self.set_window_rect(width=int(width), height=int(height))File"/home/lucas/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 1182, in set_window_rect"height": height})['value']
File "/home/lucas/.local/lib/python2.7/site packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response)
File "/home/lucas/.local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: failed to change window state to 'normal', current state is 'maximized'
(Session info: chrome=88.0.4324.182)
Chunk of code I’m running:
driver = webdriver.Chrome()
print driver.page_source.encode('utf-8')
num_pep = 0
while num_pep <= 2211:
num_pep = str(num_pep)
# Test name: docking
# Step # | name | target | value | comment
# 1 | open | /hpepdock/ | |
driver.get("http://huanglab.phys.hust.edu.cn/hpepdock/")
# 2 | setWindowSize | 1234x773 | |
driver.set_window_size(1234, 773)
tried to set the window size just below instantiating the driver? Ie below
driver = webdriver.Chrome()
placedriver.set_window_size(1234, 773)
?– Paulo Marques