10 2021 档案
摘要:import pymysql,itertools connect = pymysql.connect( user = 'm', password = '0', db = 'x', host = 'r', port = 3306, charset = 'utf8' ) con =connect.cur
阅读全文
摘要:if isinstance(item,MmzItem): data = {'xinxi':item['xinxi']} xinxia = data['xinxi'] print(len(xinxia),type(xinxia)) #print("ffffffffffffff",xinxi[0],xi
阅读全文
摘要:import pymysql import openpyxl import time def export_to_excel(worksheet, cursor, table): """ 将MySQL一个数据表导出到excel文件的一个表的函数 :param worksheet: 准备写入的exce
阅读全文
摘要:#!/usr/bin/python # -*- coding: UTF-8 -*- import random import string # 随机整数: print random.randint(1,50) # 随机选取0到100间的偶数: print random.randrange(0, 10
阅读全文
摘要:import requests from bs4 import BeautifulSoup url1 = "https://www.zzlian.com/33.html" html = requests.get(url1).content html=html.decode('utf-8') # py
阅读全文
摘要:import requests,sys from bs4 import BeautifulSoup def gethml(url): rr=requests.get(url) s=rr.content s.decode("ISO-8859-1") return s html=gethml(url)
阅读全文
摘要:select * from mm1 where ma not regexp '[ABCDEF]' 查询ma字段中不包含ABCDEF中任意字符的所有记录select * from mm1 where ma regexp '[ABCDEF]' 查询ma字段中包含ABCDEF中任意字符的所有记录selec
阅读全文
摘要:url="https://www.liepin.com/campus/" import requests from bs4 import BeautifulSoup rr=requests.get(url) soup =BeautifulSoup(rr.text, "lxml") for itema
阅读全文
摘要:url="https://www.liepin.com/job/1932123793.shtml" import requests from bs4 import BeautifulSoup rr=requests.get(url) soup =BeautifulSoup(rr.text, "lxm
阅读全文
摘要:今天写爬虫,遇到一个坑,提示[scrapy.core.scraper] ERROR: Spider must return request, item, or None, got 'Tag' in <GET https://www. 其实原因很意外,我在代码中使用了item,同时scrapy又用it
阅读全文
摘要:def __init__(self, *args, **kwargs): super(MmzzSpider, self).__init__(*args, **kwargs) # 这里是关键 self.count=0 def parse_item(self, response): soup =Beau
阅读全文
摘要:from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selen
阅读全文
摘要:python3爬虫:爬虫进阶之ajax数据爬取发布时间: 2019-02-06 19:21:14动态网页数据抓取什么是AJAX:AJAX(Asynchronouse JavaScript And XML)异步JavaScript和XML。通过在后台与服务器进行少量数据交换,Ajax 可以使网页实现异
阅读全文
摘要:#include<stdio.h> //当前程序运行时如果输入*回车,则一直显示需要补考,不停止 //原因:scanf()键盘输入,有一个缓冲区,遇到回车才结束 //*指针,对应scanf()中涉及到的变量 //保留scanf()后面的getchar(),则“吸收”了回车,只有*,整型为0,所以才显
阅读全文
摘要:1.python -m pip install --upgrade pip(升级PIP) 2.pip install wheel 3.pip install lxml 4.pip install twisted 5.pip install pywin32 6.pip install srapy
阅读全文
摘要:https://www.liepin.com/zhaopin/?headId=cac3aac257fd1a178ba8fd879700885f&pubTime=30
阅读全文
摘要:1.USB设备灯亮目的是为了在关机时仍然给USB设备充电,保证USB设备有电 2.不足:USB设备是有电了,但笔记本电脑的电池耗尽了,对电池不利 3.关闭方法:F2 进入CMOS设置--configuration-always on usb-disabled enabled:usb charge i
阅读全文
摘要:#include <stdio.h> main() { int shu,ge=0,shi=0,bai=0,qian=0; scanf("%d",&shu); if(shu<=0 || shu>=10000) printf("输入错误"); else { if(shu>=1 && shu<=9) ge
阅读全文
摘要:32位=2^32=2^10*2^10*2^10*2^2=4G 这些内存的存在使得要把地址空间留给他们,因为1个内存地址 仅 仅 对应 一个空间, 而不能对应2个,所以这些内存空间对于用户来说实际上是被 浪 费 的。这 样 用 户 的 内存实 际 并不能达到4G也就是说用 户实际能访问的大概只有 0~
阅读全文
摘要:带有防火墙的门禁系统,会识别检测到复制卡,从而进行屏蔽。滚动码属于高级防复制系统:刷复制卡,原卡会失效(东三省常见)
阅读全文
摘要://选择排序#include <stdio.h> main() { int a[10]={1,3,99,1,4,7,2,3,1,6},i,j,k,t,b; for(i=0;i<=9;i++) { k=i; for(j=i+1;j<=9;j++) if(a[k]<a[j]) { k=j;//第一轮:1
阅读全文
摘要:#include <stdio.h> main() { float x=2.0,y=1.0,z=0.0,sum=0.0; int a; for(a=1;a<=20;a++) { sum=sum+x/y; z=x; x=x+y; y=z; } printf("%f",sum); getchar();
阅读全文
摘要:#include <stdio.h> #include <math.h> main() { int s=0,a,n,i,m=0; //a=2,n=4; scanf("%d,%d",&a,&n); for(i=1;i<=n;i++) { m=pow(10,i-1)+m; //printf("%d\n"
阅读全文
摘要:控制继电器是一种自动电器,它适用于远距离接通和分断交、直流小容量控制电路,并在电力驱动系统中供控制、保护及信号转换用。控制继电器的输入量通常是电流、电压等电量,也可以是温度、压力、速度等非电量,输出量则是触点动作时发出的电信号或输出电路的参数变化。继电器的特点是当其输入量的变化达到一定程序时,输出量
阅读全文