Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Created May 27, 2016 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/db763537c03d2ebbc3f53e1485e207c2 to your computer and use it in GitHub Desktop.
Save kurozumi/db763537c03d2ebbc3f53e1485e207c2 to your computer and use it in GitHub Desktop.
【Python】Seleniumを使ってマルチスレッドでFirefoxを起動する方法
from selenium import webdriver
import threading
def browser1():
url = "https://www.google.co.jp",
browser = webdriver.Firefox()
browser.get(url)
browser.close()
def browser2():
url = "http://www.yahoo.co.jp",
browser = webdriver.Firefox()
browser.get(url)
browser.close()
if __name__ == "__main__":
th1 = threading.Thread(target=browser1)
th2 = threading.Thread(target=browser2)
th1.start()
th2.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment