I would like to iterate the function using a while loop, but it iterates only once, and after that, the program just stands still.
from selenium import webdriver
from multiprocessing import Process
def browse(url):
driver = webdriver.Chrome()
driver.get(url)
print(driver.page_source)
driver.__exit__()
Pros = []
urls = open('urls.txt')
if __name__ == '__main__':
while True:
for url_item in urls:
print(url_item)
p = Process(target=browse, args=(url_item,))
Pros.append(p)
p.start()
for t in Pros:
t.join()
urlsgets populated properly.Pros = []) inside the while loop.