原创 爬蟲兩種繞過5s盾的方法

import cloudscraper proxies = { "http": "http://127.0.0.1:7890", "https": "http://127.0.0.1:7890", } headers =

原创 如何使用python發郵件

import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText def send_email(send

原创 linux安裝selenium步驟

1,安裝selenium模塊 pip3 install selenium 2,安裝谷歌瀏覽器 yum install https://dl.google.com/linux/direct/google-chrome-stable_cu

原创 centos7中ffmpeg的安裝方法

Linux系統安裝ffmpeg & 升級ffmpeg 一、介紹 多媒體視頻處理工具FFmpeg有非常強大的功能,包括視頻採集功能、視頻格式轉換、視頻抓圖、給視頻加水印等。由於最近要處理音視頻格式轉換問題,因此需要安裝、升級ffmpeg,下面

原创 python圖片去重複算法

import os from imagededup.methods import PHash # pip install imagededup phasher = PHash() def process_file(img_path):

原创 視頻按照時間間隔抽幀方法

import cv2 import os videopath =r"1-1-2-1_fa_diantou+idle+idle_audio.mp4" pic_path = r'F:\2023_02_24\liu_hui\video_cv2

原创 根據指定漢語關鍵字獲取語料數據

from selenium import webdriver from selenium.webdriver import ChromeOptions from selenium.webdriver.common.keys import

原创 爬取天眼查工商信息

import requests import re import json import time from xlrd import open_workbook from xlutils.copy import copy class

原创 python 抓取視頻並顯示下載進度

import os import requests from tqdm import tqdm VIDEO_PATH = r'videos' def download(url,fname): # 用流stream的方式獲取url

原创 抓取youtube視頻

import subprocess url = "https://www.youtube.com/watch?v=" + video_id subprocess.call(['yt-dlp', '-f', "best*[vcodec!=

原创 python 的licence授權機制

import re import datetime from Crypto.Cipher import AES #安裝報錯參考 https://blog.csdn.net/pittpakk/article/details/1200219

原创 抖音網頁版高清視頻抓取教程selenium

廢話不多說,直接上代碼 from selenium import webdriver from selenium.webdriver import ChromeOptions import time import re from sele

原创 selenium被識別如何反屏蔽 Selenium無法點擊元素,報錯:ElementClickInterceptedException:element click intercepted

反屏蔽 現在很多網站都加上了對 Selenium 的檢測,來防止一些爬蟲的惡意爬取。即如果檢測到有人在使用 Selenium 打開瀏覽器,那就直接屏蔽。   其大多數情況下,檢測基本原理是檢測當前瀏覽器窗口下的 window.navigat

原创 使用selenium模擬登陸豆瓣網對搜索功能抓取數據

首先安裝 selenium可以直接可以用pip安裝。 pip install selenium 接下來安裝谷歌驅動,chromedriver的安裝一定要與Chrome的版本一致。 安裝地址如下: 1、http://chromedri

原创 python中集合的幾種運算方式

python中集合的幾種運算方式 set01 = {1,2,3,4,5} set02 = {1,2,3,6} #&取兩個集合都有的 print(set01&set02) #{1, 2, 3} #|並集組成新組合 print(set01