#weibo.py
# -*- coding: utf-8 -*-
from scrapy import Spider, Request, FormRequest
import re
from weibosearch.items import WeiboItem
import json
class WeiboSpider(Spider):
name = "weibo"
allowed_domains = ["weibo.cn"]
search_url = 'https://weibo.cn/search/mblog'
max_page=100
cookie_raw=''#插入自己的cookie
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,en-US;q=0.8,en;q=0.7',
'Cache-Control': ' max-age=0',
'Connection': ' keep-alive',
'Content-Type': ' application/x-www-form-urlencoded',
'Host': ' weibo.cn',
'Origin':
scrapy爬取新浪微博关键字微博
最新推荐文章于 2024-04-19 16:33:21 发布