Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
【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