Ctrl + S python硒

时间:2018-11-09 20:50:22

标签: python selenium

我有

import requests
import selenium
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from time import sleep
import urllib.request
class Bot:
def __init__(self):
    self.driver = webdriver.Chrome(executable_path=r'path/to')
    self.navigate()

def navigate(self):
    for i in range(1, 3):
        br = self.driver.get("some.page")
        ActionsChains(br).key_down(Keys.CONTROL).send_keys('a').key_up(Keys.CONTROL).perform()
        sleep(5)

我需要从该页面下载视频,打开带有该视频的页面,然后按ctrl + s,但是什么也没有发生。谁可以提供帮助?

0 个答案:

没有答案