下载文件.py
from selenium import webdriverimport osfp = webdriver.FirefoxProfile()#保存到指定目录:fp.set_preference("browser.download.folderList",2)#是否显示开始、True为显示、false为不显示、fp.set_preference("browser.download.manager.showWhenStarting",False)#指定下载的目录、os.getcwd()返回当期目录、fp.set_preference("browser.download.dir",os.getcwd())#application/octet-stream为文件类型fp.set_preference("browser.helperApps.neverAsk.saveToDisk","application/octet-stream")driver = webdriver.Firefox(firefox_profile=fp)driver.get("http://pypi.Python.org/pypi/selenium")driver.find_element_by_partial_link_text("selenium-2").click()
相关推荐
xiangxiaojun 2020-09-23
Reiki 2020-08-16
letheashura 2020-08-14
tiankele0 2020-07-29
curiousL 2020-07-18
王练 2020-07-18
tiankele0 2020-07-18
amei0 2020-07-08
Reiki 2020-07-06
Ronnyxie 2020-07-06
xiangxiaojun 2020-07-05
zhanghaibing00 2020-06-28
xiongyouqiang 2020-06-28
Ronnyxie 2020-06-27
amei0 2020-06-26
letheashura 2020-06-26
tiankele0 2020-06-26
王练 2020-06-25