【Python】Seleniumを使ってマルチプロセス(並列プロセス)でFirefoxを起動する方法
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 multiprocessing import Pool | |
def browser(url): | |
browser = webdriver.Firefox() | |
browser.get(url) | |
browser.close() | |
p = Pool(10) | |
p.map(browser, [ | |
"https://www.google.co.jp", | |
"http://www.yahoo.co.jp" | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment