python 'NoneType' object has no attribute 'get'
获取 页面链接的时候报错 'NoneType' object has no attribute 'get'
href = div.find("a").get("href")
一样的代码 换个网站获取就报错 。
最终是 数据来源的问题,解析的时候 不是所有的div 都是需要的数据 需要过滤一下
类似于这种

python 'NoneType' object has no attribute 'get'的更多相关文章
- python提示AttributeError: 'NoneType' object has no attribute 'append'【转发】
在写python脚本时遇到AttributeError: 'NoneType' object has no attribute 'append' a=[] b=[1,2,3,4] a = a.appe ...
- python提示AttributeError: 'NoneType' object has no attribute 'append'
在写python脚本时遇到AttributeError: 'NoneType' object has no attribute 'append' a=[] b=[1,2,3,4] a = a.appe ...
- python pip 'nonetype' object has no attribute 'bytes'
python pip 'nonetype' object has no attribute 'bytes' 更新 pip for Windows : python -m pip install -U ...
- 在Python中使用moviepy进行视频剪辑时输出文件报错 ‘NoneType‘ object has no attribute ‘stdout‘问题
专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt入门学习 老猿Python博文目录 老猿学5G博文目录 movipy输出文件时报错 'NoneType' ...
- python+openpyxl 获取最大行数,不是真正想获取的行数,导致替换时,报”NoneType' object has no attribute 'find'
问题描述: 使用excel对接口的数据进行管理,添加接口数据时,可能习惯性选择多行,设置了格式,导致多选了很多空行也被设置了格式,在读取这个sheet的最大行数时,发现有问题,获取到了为None的空行 ...
- pyspark AttributeError: 'NoneType' object has no attribute 'setCallSite'
pyspark: AttributeError: 'NoneType' object has no attribute 'setCallSite' 我草,是pyspark的bug.解决方法: prin ...
- AttributeError: 'NoneType' object has no attribute 'extend'
Python使用中可能遇到的小问题 AttributeError: 'NoneType' object has no attribute 'extend' 或者AttributeError: 'Non ...
- python3 AttributeError: 'NoneType' object has no attribute 'split'
from wsgiref.simple_server import make_server def RunServer(environ, start_response): start_response ...
- AttributeError: 'NoneType' object has no attribute 'split' 报错处理
报错场景 social_django 组件对原生 django 的支持较好, 但是因为 在此DRF进行的验证为 JWT 方式 和 django 的验证存在区别, 因此需要进行更改自行支持 JWT 方式 ...
随机推荐
- centos7修改yum源为阿里镜像
参考博客: https://blog.csdn.net/kxwinxp/article/details/78578492 https://blog.csdn.net/inslow/article/de ...
- [.NET Core] - 使用 EF Core 的 Scaffold-DbContext 脚手架命令创建 DbContext
Scaffold-DbContext 命令 参数 Scaffold-DbContext [-Connection] <String> [-Provider] <String> ...
- python基础学习(七)
14.return # print() 可以被执行 def doubelNumber(num): print() print() Afnum = doubelNumber() print(Afnum) ...
- Struts笔记3
struts标签 form表单标签 Action:请求地址.直接写动作名称,不用写contextPath <s:form action="/user/register.action&q ...
- 给定a、b两个文件,各存放50亿个url,每个url各占64字节,内存限制是4G,让你找出a、b文件共同的url?
package com.hadoop.hdfs; import org.apache.hadoop.yarn.webapp.hamlet.Hamlet; import org.junit.Test; ...
- FZU2018级算法第三次作业 3.16 station
题目大意: 给出1-n共n个数的入栈顺序,可以随时出栈,求出栈的最大字典序. 输入示例 输出示例 51 2 3 4 5 5 4 3 2 1 54 2 5 3 1 5 3 2 4 1 题目分析: 假设目 ...
- python第二天---字符串的魔法
# "adcbdefg" # "a" # 判断某个东西是否在里面包含 in | not in # name = "abcdefg" # # ...
- Spring Cloud Alibaba学习笔记(10) - Spring消息编程模型下,使用RocketMQ收发消息
编写生产者 集成 添加依赖 <dependency> <groupId>org.apache.rocketmq</groupId> <artifactId&g ...
- codeforce 849D. Make a Permutation!
D. Make a Permutation! time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
- RabbitMQ的应用场景
进入正题. 一.异步处理 场景:发送手机验证码,邮件 传统古老处理方式如下图 这个流程,全部在主线程完成,注册->入库->发送邮件->发送短信,由于都在主线程,所以要等待每一步完成才 ...