Downloading a file at a specified location through python and selenium using Chrome driver

后端 未结 8 1523
囚心锁ツ
囚心锁ツ 2020-12-01 02:56

I am trying to automatically download some links through selenium\'s click functionality and I am using a chrome webdriver and python as the programming lan

8条回答
  •  臣服心动
    2020-12-01 03:40

    To provide download directory and chrome's diver executable path use the following code.

    from selenium import webdriver
    options = webdriver.ChromeOptions() 
    options.add_argument("download.default_directory=C:/Your_Directory")
    driver = webdriver.Chrome(options=options ,executable_path='C:/chromedriver')
    

    change the path in your code accordingly.

提交回复
热议问题