Skip to content

Commit 40a9e5f

Browse files
authored
Merge pull request #61 from MaloneGod/patch-3
Update the visited list
2 parents f858324 + 4cc9b02 commit 40a9e5f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

chapter16/multiprocess_queue.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ def task_delegator(taskQueue, foundUrlsQueue):
2121
for link in links:
2222
#Add new link to the taskQueue
2323
taskQueue.put(link)
24+
#Add new link to the visited list
25+
visited.append(link)
2426

2527
def get_links(bsObj):
2628
links = bsObj.find('div', {'id':'bodyContent'}).find_all('a', href=re.compile('^(/wiki/)((?!:).)*$'))
@@ -51,4 +53,4 @@ def scrape_article(taskQueue, foundUrlsQueue):
5153
processes.append(Process(target=scrape_article, args=(taskQueue, foundUrlsQueue,)))
5254

5355
for p in processes:
54-
p.start()
56+
p.start()

0 commit comments

Comments
 (0)