Last active
October 17, 2020 03:19
-
-
Save gumdropsteve/0f8ecb1a1e7fc37a6e0bfedf72e4464c to your computer and use it in GitHub Desktop.
Simple test to see if Selenium is correctly installed
This file contains hidden or 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 time import sleep | |
from selenium import webdriver | |
story = 'https://medium.com/dropout-analytics/selenium-and-geckodriver-on-mac-b411dbfe61bc' | |
story = story + '?source=friends_link&sk=18e2c2f07fbe1f8ae53fef5ad57dbb12' # 'https://bit.ly/2WaKraO' <- short link | |
def gecko_test(site_000=story): | |
""" | |
simple overview: | |
1) set up webdriver | |
2) load this article | |
3) close up shop | |
input: | |
>> site_000 | |
> default: url of this article ('friend link') | |
""" | |
# set the driver | |
driver = webdriver.Firefox() | |
# load this article | |
driver.get(site_000) | |
# and chill a bit | |
sleep(7) | |
# k, cool. let's bounce. | |
driver.quit() | |
# make runable | |
if __name__ == '__main__': | |
# here we go | |
gecko_test() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Same Test for Chromedriver