Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 在全屏、selenium和python中打开ChromeDriver_Macos_Selenium Webdriver_Selenium Chromedriver - Fatal编程技术网

Macos 在全屏、selenium和python中打开ChromeDriver

Macos 在全屏、selenium和python中打开ChromeDriver,macos,selenium-webdriver,selenium-chromedriver,Macos,Selenium Webdriver,Selenium Chromedriver,我正试图全屏打开我的ChromeDriver。 我已经尽了一切可能,但似乎找不到解决办法。 在谷歌和stackoverflow搜索之后,似乎很多人都遇到了同样的问题,这是针对MacOSX的。我原以为执行(命令、移位、f)会奏效,但实际上不行。有人有解决办法吗 from selenium import webdriver from selenium.webdriver.common.keys import Keys import time urls = [x

我正试图全屏打开我的ChromeDriver。 我已经尽了一切可能,但似乎找不到解决办法。 在谷歌和stackoverflow搜索之后,似乎很多人都遇到了同样的问题,这是针对MacOSX的。我原以为执行(命令、移位、f)会奏效,但实际上不行。有人有解决办法吗

     from selenium import webdriver
     from selenium.webdriver.common.keys import Keys
     import time
     urls = [x,y,z]
     driver = webdriver.Chrome() #Would like chrome to start in fullscreen
     driver.find_element_by_tag_name('body').send_keys(Keys.COMMAND, Keys.SHIFT, 'f') #not sure why this doesn't work.
     driver.get("https://example.com") 

使用chrome\u选项启动带有参数“-kiosk”的chrome

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chromeOptions = Options()
chromeOptions.add_argument("--kiosk")
driver = webdriver.Chrome(chrome_options=chromeOptions) #Would like chrome to start in fullscreen
driver.get("https://example.com")
driver.quit() 

谢谢大家!@斯顿古塔。我看过这个,但不知道我必须导入选项。