随笔分类 -  python

上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 25 下一页
python学习
摘要:打开CHARLES,打开PROXY SETTINGS:选择enable transparent HTTP proxyinghelp--ssl 安装证书,微信电脑版登录微信 阅读全文
posted @ 2021-12-01 17:00 myrj 阅读(49) 评论(0) 推荐(0)
摘要:如何防止被反编译? 打包时候加上密码,让pyc变为pyd,命令如下: pyinstaller -F --key 123 xxx.py --key后面跟的是你的密码 阅读全文
posted @ 2021-11-25 09:48 myrj 阅读(104) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-11-24 05:59 myrj 阅读(62) 评论(0) 推荐(0)
摘要:import re,pymysql,requests,sys,json,time import telnetlib connect = pymysql.connect(user = 'm', password = 'M', db = 'xi', host = 'r', port = 3306, ch 阅读全文
posted @ 2021-11-23 14:45 myrj 阅读(192) 评论(0) 推荐(0)
摘要:import base64 proxy_ip_port = "123.456.789.10:8888" proxy_user_pass = "awesome:dude" request = Request(url, callback=self.parse) # Set the location of 阅读全文
posted @ 2021-11-22 08:18 myrj 阅读(98) 评论(0) 推荐(0)
摘要:from openpyxl import Workbook class TuniuPipeline(object): # 设置工序一 self.wb = Workbook() self.ws = self.wb.active self.ws.append(['新闻标题', '新闻链接', '来源网站 阅读全文
posted @ 2021-11-20 11:18 myrj 阅读(47) 评论(0) 推荐(0)
摘要:self.meta = { 'dont_redirect': True, # 禁止网页重定向 'handle_httpstatus_list': [301, 302] # 对哪些异常返回进行处理 } def start_requests(self): sql="select * from lpwz 阅读全文
posted @ 2021-11-20 09:54 myrj 阅读(236) 评论(0) 推荐(0)
摘要:cf = configparser.ConfigParser() ac=cf.read("my.ini")cookie = driver.get_cookies() xx=driver.get_cookie(name="zp_passport_deepknow_sessionId") xx1=dri 阅读全文
posted @ 2021-11-11 09:21 myrj 阅读(355) 评论(0) 推荐(0)
摘要:import emoji #去掉表情等特殊字符 jieshao="包括表情的字符串" jieshao=emoji.demojize(jieshao) def filter_emoji(self,desstr,restr='[emoji]'): ''' 过滤表情 ''' try: co = re.co 阅读全文
posted @ 2021-11-09 05:46 myrj 阅读(1187) 评论(0) 推荐(0)
摘要:''' 三种等待方法: 1.强制等待sleep(xx) 强制等待,不管你浏览器是否加载完了,程序都得等待,时间一到,继续执行下面的代码,作为调试很有用,有时候也可以在代码里这样等待,不过不建议总用这种等待方式,太死板,严重影响程序执行速度。 2.隐性等待implicitly_wait(xx) 隐形等 阅读全文
posted @ 2021-11-05 19:30 myrj 阅读(5494) 评论(0) 推荐(0)
摘要:from selenium.webdriver import Remote from selenium.webdriver.chrome import options from selenium.common.exceptions import InvalidArgumentException im 阅读全文
posted @ 2021-11-03 17:19 myrj 阅读(265) 评论(0) 推荐(0)
摘要:import pymysql connect = pymysql.connect(user = 'm', password = 'M', db = 'x', host = 'rm', port = 3306, charset = 'utf8' ) con = connect.cursor() bu= 阅读全文
posted @ 2021-11-03 16:57 myrj 阅读(881) 评论(0) 推荐(0)
摘要:import configparser,sys cf = configparser.ConfigParser() #写INI def xini(): executor_url = "100" session_id = "6666" cf.add_section("ssh") cf.set("ssh" 阅读全文
posted @ 2021-11-03 14:04 myrj 阅读(352) 评论(0) 推荐(0)
摘要:UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 14-14: Non-BMP character not supported in Tk 出现类似表明不能输出相应的代码,只要不输出就不报错了 阅读全文
posted @ 2021-11-02 05:57 myrj 阅读(433) 评论(0) 推荐(0)
摘要:import pymysql,itertools connect = pymysql.connect( user = 'm', password = '0', db = 'x', host = 'r', port = 3306, charset = 'utf8' ) con =connect.cur 阅读全文
posted @ 2021-10-30 07:08 myrj 阅读(107) 评论(0) 推荐(0)
摘要:if isinstance(item,MmzItem): data = {'xinxi':item['xinxi']} xinxia = data['xinxi'] print(len(xinxia),type(xinxia)) #print("ffffffffffffff",xinxi[0],xi 阅读全文
posted @ 2021-10-30 04:52 myrj 阅读(154) 评论(0) 推荐(0)
摘要:import pymysql import openpyxl import time def export_to_excel(worksheet, cursor, table): """ 将MySQL一个数据表导出到excel文件的一个表的函数 :param worksheet: 准备写入的exce 阅读全文
posted @ 2021-10-29 09:53 myrj 阅读(597) 评论(0) 推荐(0)
摘要:#!/usr/bin/python # -*- coding: UTF-8 -*- import random import string # 随机整数: print random.randint(1,50) # 随机选取0到100间的偶数: print random.randrange(0, 10 阅读全文
posted @ 2021-10-26 06:16 myrj 阅读(104) 评论(0) 推荐(0)
摘要:import requests from bs4 import BeautifulSoup url1 = "https://www.zzlian.com/33.html" html = requests.get(url1).content html=html.decode('utf-8') # py 阅读全文
posted @ 2021-10-25 06:16 myrj 阅读(943) 评论(0) 推荐(0)
摘要: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) 阅读全文
posted @ 2021-10-24 19:20 myrj 阅读(52) 评论(0) 推荐(0)

上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 25 下一页