摘要: #!/usr/bin/python # -*- coding: utf-8 -*- from selenium import webdriver import xlwt,csv,time import os # os.remove('51job爬虫.xls') startup_Options = w 阅读全文
posted @ 2021-07-03 22:36 Avicii_2018 阅读(167) 评论(0) 推荐(0)
摘要: file_path= r'./extract.yaml' if not os.path.exists(file_path): os.startfile(file_path) 在现代 Python 开发中,我们推荐使用 pathlib(处理路径)和 subprocess(执行命令)模块。 from p 阅读全文
posted @ 2026-05-10 18:13 Avicii_2018 阅读(3) 评论(0) 推荐(0)
摘要: def write_yaml_data(self,value): """ 写入数据到yaml文件 """ file_path= r'./extract.yaml' # if not os.path.exists(file_path): # os.startfile(file_path) try: w 阅读全文
posted @ 2026-05-10 17:31 Avicii_2018 阅读(2) 评论(0) 推荐(0)
摘要: user = {'name':'Alex','age': 18} 普通查询(直接通过键访问): user['name'] 如果你查询一个不存在的键, 程序会直接报错(KeyError)并崩溃 使用.get() 方法: user.get('name') 如果你查询一个不存在的键, 程序不会报错, 而是 阅读全文
posted @ 2026-05-10 17:17 Avicii_2018 阅读(3) 评论(0) 推荐(0)
摘要: """ Author: Created: Description: """ import time from openpyxl import Workbook result = [{'id': 105, 'name': '010医院', 'phonenumber': '1353369010', 'a 阅读全文
posted @ 2025-04-08 23:08 Avicii_2018 阅读(53) 评论(0) 推荐(0)
摘要: 代码中有如下告警: 1. Unresolved attribute reference 'status_code' for class 'object' 这个错误通常出现在使用Python进行编程时,尤其是在使用类似于Django或Flask这样的Web框架时。它意味着你尝试在一个类的实例中访问一个 阅读全文
posted @ 2024-12-25 20:43 Avicii_2018 阅读(228) 评论(0) 推荐(0)