This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable Marionette, An automation driver for Mozilla's Gecko engine | |
def setUpCapabilities(self): | |
self.capabilities = webdriver.DesiredCapabilities.FIREFOX | |
self.capabilities['marionette'] = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setUpProfile(driver): | |
driver.profile = webdriver.FirefoxProfile() | |
driver.profile.add_extension("buster_captcha_solver_for_humans-0.6.0.xpi") # add buster extension path | |
driver.profile.set_preference("security.fileuri.strict_origin_policy", False) # disable Strict Origin Policy | |
self.profile.update_preferences() # Update profile with new configs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup settings | |
def setUp(self): | |
self.setUpProfile() # for setup profiles | |
self.setUpOptions() # options for running gecko | |
self.setUpCapabilities() # enable some abilities like marionette | |
self.setUpProxy() # setup proxy if you get ban | |
self.driver = webdriver.Firefox(options=self.options, capabilities=self.capabilities, firefox_profile=self.profile) # initialize web driver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SyncMe(unittest.TestCase): | |
# Main function | |
def test_run(self): | |
pass | |
def tearDown(self): | |
pass | |
if __name__ == "__main__": | |
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup proxy | |
def setUpProxy(self): | |
self.capabilities['proxy'] = { "proxyType": "MANUAL", "httpProxy": PROXY, "ftpProxy": PROXY, "sslProxy": PROXY } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_run(self): | |
driver = self.driver | |
number = self.number | |
self.log("Start get") | |
driver.get('https://sync.me') | |
self.log("End get") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.common.action_chains import ActionChains | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.common.proxy import Proxy, ProxyType | |
from selenium.common.exceptions import NoSuchElementException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am thelematic on github. | |
* I am psyperbong (https://keybase.io/psyperbong) on keybase. | |
* I have a public key ASDko1nuZzQqXldw_KRYJd9JsVdMZQcTn-efqyEj7i7NOQo | |
To claim this, I am signing this object: |
NewerOlder