Skip to content

Instantly share code, notes, and snippets.

@portothree
Created May 26, 2019 03:34
Show Gist options
  • Save portothree/49026e8abcab3e697d18da00b7764372 to your computer and use it in GitHub Desktop.
Save portothree/49026e8abcab3e697d18da00b7764372 to your computer and use it in GitHub Desktop.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver import ActionChains
profile = webdriver.FirefoxProfile()
profile.set_preference("general.useragent.override", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.53 Safari/525.19")
profile.set_preference('permissions.default.image', 2)
profile.set_preference('dom.ipc.plugins.enable.libflashplayer.so', 'false')
driver = webdriver.Firefox(profile)
driver.get()
element = driver....
actionsChains = ActionChains(driver)
actionsChains.context_click(element).perform()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment