python 爬取中国木材价格指数网
完整代码:https://github.com/tanjunchen/SpiderProject/tree/master/yuzhuprice
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime from concurrent.futures.thread import ThreadPoolExecutor from multiprocessing import Pool, Manager import requests from fake_useragent import UserAgent from lxml import etree import pandas as pd ua = UserAgent() def error_func(x): print(x) print('进程退出') def spider(task_queue, data_queue): base_url = 'http://www.yuzhuprice.com/CTIExponent.jspx?' while True: task = task_queue.get() if task == 'exit': task_queue.put(task) return for number in range(1, 99): data = { 'page.curPage': str