📜  python下载完整网页——Python代码示例

📅  最后修改于: 2022-03-11 14:46:50.503000             🧑  作者: Mango

代码示例1
# pip install selenium
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys

br = webdriver.Firefox(firefox_binary=binary,
                               executable_path="path_to_webdriver")

br.get('http://www.google.com/')

save_me = ActionChains(br).key_down(Keys.CONTROL)\
         .key_down('s').key_up(Keys.CONTROL).key_up('s')
save_me.perform()