python爬虫 动作链进阶
#动作链进阶
import time from selenium import webdriver from selenium.webdriver.firefox.options import Options as FOptions options=FOptions() browser=webdriver.Firefox(executable_path="/Users/mac126/geckodriver",firefox_options=options)
# browser.get('http://www.runoob.com/try/try.php?filename=jqueryui-api-droppable') # browser.switch_to.frame('iframeResult') # source=browser.find_element_by_id('draggable') # target=browser.find_element_by_id('droppable') # actions=ActionChains(browser) # # actions.drag_and_drop(source,target) # actions.perform() # time.sleep(2) # t=browser.switch_to_alert() # print(t.text) # t.accept() # time.sleep(10) # browser.close()