[ gerapy-scrapy可视化 ]


gerapy可视化爬虫

  1. 前提条件

    • 写好的scrapy爬虫项目
    • 安装, 并运行scrapyd提供项目对接端口6800
  2. 安装

pip install gerapy
  1. 初始化
    • 自动会创建可视化项目
gerapy init
  1. 生成数据库迁移
gerapy migrate
  1. 运行
gerapy runserver
  1. 主机管理
端口号写6800
  1. 项目管理
    1. 点击部署进入
    2. 打包项目把写好的scrapy导入, 打包成压缩包,或者直接复制项目到gerapy里的project文件夹里面
    3. 点击部署
  1. 执行
    1.

< Read more >

[ scrapy分布式爬虫基础 ]


scrapy基本使用

  1. 安装
pip install scrapy
  1. 创建项目
scrapy startporject 项目名
  1. 创建爬虫文件
cd 项目名 # 进入项目文件夹
scrapy genspider chf www.xxxx.com # chf是爬虫文件名, www.xxx.com是要爬的网站域名
  1. 运行
    • 保存为jsn文件
    • 保存为csv文件
scrapy crawl 爬虫文件名 -o wangzhan.json
或
scrapy crawl 爬虫文件名 -o wangzhan.csv

< Read more >

[ Python二维码生成 ]


python二维码生成

  • flask版本
  • fastapi版本
  • 记得安装库
# from flask import Flask, make_response
# import qrcode
# import io

# app = Flask(__name__)

# @app.route("/image")
# def index():
#     qr = qrcode.QRCode(
#         version=3,
#         error_correction=qrcode.ERROR_CORRECT_L,
#         box_size=10

< Read more >

[ Selenium参考文章 ]


参考文章

  1. 安装需要先下载驱动
from selenium.webdriver.common.action_chains import ActionChains # 导包。鼠标
from selenium import webdriver # 浏览器导包
import time #时间导包
from selenium.webdriver.common.by import By # 元素导包
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expecte

< Read more >

[ 创建pod服务 ]


一. 配置字典

  1. 配置字典 1. 配置字典

  2. 配置字典 - 名字 2. 名字

  3. 配置字典 - 文件 3. 字典配置

二. 配置副本集pod

  1. 有状态副本集 4. 有状态服务

  2. 有状态副本集 - 名字 5

  3. 有状态副本集 - 容器配置1 6

  4. 有状态副本集 - 容器配置2 7

  5. 有状态副本集 - 储存配置 8

  6. 有状态副本集 - 储存配置 - 挂载持久卷 9

  7. 有状态副本集 - 储存配置 - 挂载配置字典 10

  8. 创建服务 11

  9. 创建服务 - 指定工作负载 12

  10. 创建服务 - 名字 13

  11. 创建服务 - 服务配置(选择访问模式, 保留端口, 选择工作负载) 14

  12. 创建服务 - 高级设置 - 外部访问 15

  13. 查看创建完成的服务 16

  14. 使用服

< Read more >

[ kubesphere流水线 ]


jenkinsfile文件

  • REGISTRY环境变量为dockerhub私有仓库的ip地址
  • DOCKERHUB_NAMESPACE为dockerhub私有仓库的命名空间

1.前端vue3项目配置到nginx

  • 自己指定docker镜像node:latest容器
pipeline {
  agent {
    kubernetes {
      inheritFrom 'nodejs base'
      containerTemplate {
        name 'nodejs'
        image 'node:latest&#

< Read more >

[ 内网穿透frp ]


官网

  • linux系统下载frp_0.49.0_linux_amd64.tar.gz

客户端frpc.ini

[common]
# 服务端端口ip
server_addr = 47.120.55.99
# 与服务端对接的端口
server_port = 9999
token = test@123

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 7000

[k8s]
type = http
# 客户端本地要转发的ip
local_ip = 192.168.50.205
# 客户端本地要转发的端口
loc

< Read more >

[ 百度图片识别api ]


百度智能云api

1. 创建应用

https://console.bce.baidu.com/ai/#/ai/ocr/app/list

2. 调试api

https://console.bce.baidu.com/tools/#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E9%80%9A%E7%94%A8%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Fgeneral_basic&method=post

代码演示

imp

< Read more >