自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 selenium无头浏览器配置教程

from selenium import webdriverfrom time import sleep#无头浏览器引入模块from selenium.webdriver.chrome.options import Options#无头浏览器设置chrome_options = Options()chrome_options.add_argument('--headless')chrome_options.add_argument('--disable-gpu')#无头浏览器增加属性op

2021-10-26 09:09:57 7032

原创 python邮件发送带附件(可用,可以发送成功)

import smtplibfrom email.mime.text import MIMETextfrom email.mime.multipart import MIMEMultipartfrom email.header import Header# 第三方 SMTP 服务mail_host = "smtp.qq.com" # 设置服务器mail_user = "40***61@qq.com" # 用户名mail_pass = "mbm****hfjmbjij" # 口令sen

2021-09-08 08:09:48 345

原创 python生成txt文件

import osdef create_txt(filename): //获取当前文件所在路径 filepath = os.getcwd() print(filepath) file_path = filepath + '\\' + filename + '.txt' print(file_path) #exit() file = open(file_path, 'w') file.close()create_txt('kangkang')

2021-09-07 17:30:29 3299

原创 python线程池pool.map的使用

import requestsimport timefrom multiprocessing.dummy import Poolheaders = { 'user-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36'}urls = [ 'https://sp1.baidu.com/

2021-09-07 15:37:48 6160 4

原创 PHP_EOL怎么用是什么?-PHP_EOL有什么用处-php_eol为什么没有换行

PHP_EOL怎么用是什么?<?phpecho PHP_EOL;//windows平台相当于 echo "\r\n";//unix\linux平台相当于 echo "\n";//mac平台相当于 echo "\r";?>PHP_EOL有什么用处PHP 中换行可以用 PHP_EOL 来替代,以提高代码的源代码级可移植性php_eol为什么没有换行php_eol为什么没有换行,您需要看下是在哪里输出使用的,如果是在html里面输出使用是无效的;html需要添加

2021-09-02 08:27:33 1526

原创 python检测网址状态是否正常-多线程版本

import urllib.requestimport timeimport threadingopener = urllib.request.build_opener()# opener.addheaders = [('User-agent', 'Mozilla/49.0.2')]file = open(r'urls.txt')lines = file.readlines()def work(): while True: if len(lines) >

2021-09-01 11:34:29 602

原创 python遍历json数据方法

python遍历json数据方法代码案例items = { "code": "success", "msg": "成功", "data": [{ "id": 13, "imgurl": "http:\/\/tu.sdgpicpic.cn\/b02dj3542\/12.jpg" }, { "id": 12, "imgurl": "http:\/\/tu.sdgpicpic.cn\/b02dj3530\/11.jpg" }, { "id": 11, "imgurl":

2021-09-01 10:51:16 16324 2

原创 python取网站标题

这里写自定义目录标题直接上代码直接上代码import urllib.requestimport rewebs = ['https://www.网址.cn/','http://www.网址.com/']def get_title(url): try: page = urllib.request.urlopen(url=url) except Exception as e: print(e) else: html = pag

2021-09-01 10:42:07 289

原创 python获取网站标题-教程-代码-python web

#!/usr/bin/python#coding=utf-8#urllib2是python自带的模块,在python3.x中被改为urllib.requestimport urllib.requestimport rewebs = ['https://www.baidu.com/','http://www.xxx.com/']def get_title(url): try: page = urllib.request.urlopen(url=url) ex

2021-04-23 09:14:28 280 1

原创 帝国cms生成文章的时候提示Table ‘***.表前缀_ecms_news_data_‘ doesn‘t exist

当帝国cms搬家或者是换域名搭建的时候生成内容页就会出现Table ‘***.表前缀_ecms_news_data_’ doesn’t exist这个错误,下面我们直接看解决办法。到帝国cms后台执行sql语句的功能执行以下语句:delete from 自己的表前缀_ecms_news_index where id not in (select id from 自己的表前缀_ecms_news_data_1)具体步骤:系统-执行sql语句-然后把语句放入文本框执行即可。...

2021-04-08 09:27:39 1312

原创 php文章插入ASCII码函数

php文章插入ascii码函数<?php//文章插入ASCII码处理部分starfunction rep_code(&$html){ $html= preg_replace_callback("/(,|?|。|:|、)/", function ($ms) { $c = mt_rand(3, 5); $t = ''; for ($i = 0; $i < $c; $i ++) { $t .= c

2021-03-23 10:37:17 500

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除