具有多进程的Python刮刀

具有多进程的Python刮刀,python,lxml,python-multithreading,python-multiprocessing,Python,Lxml,Python Multithreading,Python Multiprocessing,我目前正在学习使用python,我的第一个目标是在我的网站的每一页上删去每一篇文章 我想在第一页得到所有的文章,并在每篇文章上删除标题,当它完成时,我想在下一页做同样的事情 实际上,我可以取消所有链接和第一页,多进程无限期地获得第一页的链接。我不知道我怎么能在同一时间废掉所有链接的标题,废掉网站每页的链接 #!/usr/bin/env python # -*- coding: utf-8 -*- from lxml import html import requests import mult

我目前正在学习使用python,我的第一个目标是在我的网站的每一页上删去每一篇文章

我想在第一页得到所有的文章,并在每篇文章上删除标题,当它完成时,我想在下一页做同样的事情

实际上,我可以取消所有链接和第一页,多进程无限期地获得第一页的链接。我不知道我怎么能在同一时间废掉所有链接的标题,废掉网站每页的链接

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from lxml import html
import requests
import multiprocessing
import concurrent.futures

i = 0

def get_informations(link):
    page = requests.get('http://myWebsite.com/'+link)
    tree = html.fromstring(page.text)
    titre = tree.xpath('//*[@id="infosSpectacle"]/ul/li[1]/h2/text()')
    print titre

while True:
    page = requests.get('http://myWebsite.com/Articles?Page='+str(i))
    tree = html.fromstring(page.text)
    links = tree.xpath("//a/@href")
    links = set(links)

    executor = concurrent.futures.ProcessPoolExecutor(10)
    futures = [executor.submit(get_informations, link) for link in links]
    concurrent.futures.wait(futures)
    i =+ 1    
    #How can I go to the second page with the Process ?? 
谢谢你的帮助