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 方式 ...
随机推荐
- nightwatch对前端做自动化测试
记录node环境使用nightwatch.selenium-server.chromedriver对部署后的前端页面进行自动化测试的项目搭建过程. 1.目标 能对部署后的前端项目进行自动化测试,能自动 ...
- http拦截器-HandlerInterceptor
简介 拦截器我想大家都并不陌生,最常用的登录拦截.权限校验.防重复提交.记录日志等等,总之可以去做很多的事情. 自定义拦截器HandlerInterceptorAdapter 我们以记录日志为例,介绍 ...
- SQL语言(二)
SQL约束与策略 create table student( id int primary key, //主键约束 name ) not null, //非空约束 idCard ) unique, / ...
- PHP get和post向服务器发送请求
1 .get请求 <?php //请求url地址 $token="xxx"; $url = "请求的地址"; //初始化curl $ch = curl_i ...
- vue设置input不可编辑切换
html: <Input name="a" v-model="formValidate.coName" placeholder="请输入姓名&q ...
- Notepad++连接VMWare中Linux只能看到/root目录
如下图,使用SFTP协议连接,用root用户登录后,我一开始只能看到root下的文件.稍作修改,把下面的“Initial remote directory”设置成“/”就可以看到根目录了.
- Centos7阿里云安装OpenProject-亲测
10/182019年10月18日13:50 参考 <https://ywnz.com/linuxyffq/4085.html> 说在前头:网上有各种教程,包括官方自己的教程,在阿里云服务器 ...
- 自定义AuthorizeFilter
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization.Infrastructure; u ...
- JS 客户端(浏览器)存储数据之 localStorage、sessionStorage和indexDB
基本概念 1.localStorage和sessionStorage是HTML5 Web存储的提供的两种存储方式,在IE7以上以及大多数浏览器都是支持的 2.localStorage和sessionS ...
- Story of Jerry Wang's Wechat subscription account
As an SAP Techinical Ambassador,Jerry is always willing to share his SAP expertise to various social ...