0

Below given is a sample program to call selenium process again and again. please help me to learn how can i perform multiprocessing/multithreading (multitasking).

urls= [consider 10 urls]
def selenium(urls)
    driver = webdriver.PhantomJS(desired_capabilities = dcap,service_args=['--ignore-ssl-errors=true', '--load-images=false'])
    driver.get(url)
    some_process()

for i in urls:
    selenium(i)

Task here is to run all the given urls in one shot at same time with different background panthomjs browsers
Asynchronous processing of links.

Dinu Duke
  • 185
  • 13
  • I had similar task lately. I created couple threads and each thread were running browser instance. You can also use some unit testing libraries functionality to run tests in parallel. In Java world we have TestNG which can do parallel execution. – sen4ik Jun 26 '17 at 17:22
  • you can use Multi threading. You can see a similar example : [https://stackoverflow.com/questions/2846653/how-to-use-threading-in-python](https://stackoverflow.com/questions/2846653/how-to-use-threading-in-python) – Vardhman Patil Jun 27 '17 at 06:27

0 Answers0