使用rabbit实现分布式爬虫抓取妖火网

本文介绍如何利用rebbit实现分布式爬虫,以抓取妖火网为例,着重讲解分布式爬虫的实现过程,数据提取部分简略。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用rebbit实现分布式爬虫的例子

数据提取没有很详细,这部分不是重点

# -*- coding:utf-8 -*-
# @Author: YOYO
# @Time: 2018/10/11 10:40
# @说明:
import json
import re
import sys
import threading

import time
import traceback
from os import popen

from lxml import etree

import requests

from rq import send_task, recv_task

reload(sys)
sys.setdefaultencoding('utf8')
class Yhuo(object):
    def __init__(self):
        self.s=requests.session()
        self.headers={

        }
        self.url_list_queue='url_list_queue'
        self.detail_url_queue='detail_url_queue'
        self.data_queue='data_queue'
    def login(self):
        url = "https://yaohuo.me/waplogin.aspx"
        payload = "logname=13438&logpass=xxxx&savesid=0&action=login&classid=0&siteid=1000&sid=-3-0-0-0-0&backurl=wapindex.aspx%3Fsiteid%3D1000&g=%E7%99%BB+%E5%BD%95"
        headers = {
            'accept': "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
            'accept-encoding': "gzip, deflate, br",
            'accept-language': "zh-CN,zh;q=0.9",
            'cache-control': "no-cache",
            'content-length': "124",
            'content-type': "application/x-www-form-urlencoded",
            'origin': "https://yaohuo.me",
            'referer': "https://yaohuo.me/waplogin.aspx",
      
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值