Python + MySQL 批量查询百度收录】的更多相关文章

做SEO的同学,经常会遇到几百或几千个站点,然后对于收录情况去做分析的情况 那么多余常用的一些工具在面对几千个站点需要去做收录分析的时候,那么就显得不是很合适. 在此特意分享给大家一个批量查询百度收录状况的代码 使用 Python + MySQL(MariaDB) 配合使用 import pymysql from urllib import request import re import time import os,sys # 数据操作类 class DataExec: # 定义私有属性 #…
0 前言 写报告的时候为了细致性,要把IP地址对应的地区给整理出来.500多条IP地址找出对应地区复制粘贴到报告里整了一个上午. 为了下次更好的完成这项重复性很高的工作,所以写了这个小的脚本. 1 使用库 1)requests 简介:Requests是一常用的http请求库,它使用python语言编写,可以方便地发送http请求,以及方便地处理响应结果. 安装方法:pip install requests 帮助手册:http://docs.python-requests.org/zh_CN/la…
MySQL慢查询会话监控 #!/usr/bin/python # -*- coding: UTF-8 -*- from email.mime.text import MIMEText from email.utils import formataddr from email.mime.multipart import MIMEMultipart import MySQLdb import smtplib import datetime import logging import logging.…
一般批量查询的时候都是in关键字,但是在数据量大的时候,效率低下. 这个时候我们就可以考虑使用union . xml 核心代码 <select id="selectList" resultMap="BaseResultMap" parameterType="java.util.List" > <foreach collection="list" item="item" index=&quo…
1.工具说明 写报告的时候为了细致性,要把IP地址对应的地区给整理出来.500多条IP地址找出对应地区复制粘贴到报告里整了一个上午. 为了下次更好的完成这项重复性很高的工作,所以写了这个小的脚本. 某个项目每次改需求都是这么突然. 应 XX 每天要求各种省份域名统计,再加强下Domain to IP to 地区的脚本. Domain2ip2locality.py v2.0 写入到XLS中 Domain2ip2locality.py v3.0 增加域名解析IP.IP解析地区的部分 2.使用方法 把…
因为 数据量比较多, 比如每次 /** * 批量查询 * @param sourList * @param batchCount * @param userMapper * @return */ public List<User> dealBySubList(Set<String> sourList,Integer batchCount,UserMapper userMapper){ List<User> userList = new ArrayList<User…
一.写法 cursor.execute('insert into user (name,password) value (?,?)',(name,password)) 或者 cursor.execute('insert into user (name,password) value (%s,%s)',(name,password)) %s与?都可以作为sql语句的占位符,它们作为占位符的功能是没有区别的,mysql.connector用 %s 作为占位符:pymysql用 ? 作为占位符.但是注…
一.背景: 最近工作中做了一个小功能,目的是为了分析注册用户区域分布和订单的区域分布情况.所以需要将其对应的IP信息解析为归属地,并同步每天同步更新.线上跑起来效率还是有优化的空间,优化的方向:在调用IP查询API过程可以调整为多线程并行解析IP.后续会更新这方便的调整.技术: Pyhton3 postgreSQL env配置文件 附加信息:iP地址查询(iP138官方企业版):https://market.aliyun.com/products/56928004/cmapi015606.htm…
#coding=utf-8 import mysql.connector import importlib import sys #连接数据库的信息 mydb = mysql.connector.connect( host='115.xx.10.121', port=', user='root', password='xxxxxZ6XPXbvos', ) mycursor=mydb.cursor() #创建数据库 mycursor.execute('create database test_cc…
#!usr/bin/python# -*- coding:utf-8 -*-import urllib2 import re import MySQLdb class BaiDuNews: def __init__(self): self.baseurl = 'http://news.baidu.com/' def getPage(self): request = urllib2.Request(self.baseurl) response = urllib2.urlopen(request)…