python under the browser run silently drive

 Here to chromdriver, for example, placed driver on a path problem see the problem. And almost java process, python achieve silent operation as follows

 

First answer Why be silent run?

We generally facilitate local debugging GUI interface can run a browser, but we can only run with a non-GUI mode on the server, because the server is linux environment generally no visual interface of the browser

 

 FIG Code:

 

Source:

from selenium import webdriver


option=webdriver.ChromeOptions()
option.add_argument("headless")
driver=webdriver.Chrome(chrome_options=option)
driver.get("https://www.cnblogs.com/yoyoblogs/")
print(driver.title)

 

Guess you like

Origin www.cnblogs.com/yoyoblogs/p/11113312.html