关于 'list' object has no attribute 'select'
我是在写爬虫是遇到了这个问题:
c = chapter.select('href')
AttributeError: 'list' object has no attribute 'select'
这是我的代码:
chapter = soup.select('ul._chapter > li > a')
c = chapter.select('href')
原因: select 返回的是一个列表list, 而list是没有select方法的. 所以用不了.
解决办法,换正则,详见: https://blog.csdn.net/qq_41684261/article/details/86627580
关于 'list' object has no attribute 'select'的更多相关文章
- 'module' object has no attribute 'select'
和tensorflow的版本有关系 新版本 将tf.select替换为tf.where
- Python AttributeError: 'Module' object has no attribute 'STARTF_USESHOWINDOW'
夫学须志也,才须学也,非学无以广才,非志无以成学.--诸葛亮 生活有度,自得慈铭 --杜锦阳 今天新来的同事安装环境遇到个莫名其妙的问题: AttributeError: 'Module' objec ...
- pyspark AttributeError: 'NoneType' object has no attribute 'setCallSite'
pyspark: AttributeError: 'NoneType' object has no attribute 'setCallSite' 我草,是pyspark的bug.解决方法: prin ...
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...
- AttributeError: 'list' object has no attribute 'write_pdf'
我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...
- AttributeError: '_csv.reader' object has no attribute 'next'
我在使用pyhon3.4运行以下代码时报错:AttributeError: '_csv.reader' object has no attribute 'next' import csv import ...
- attributeError:'module' object has no attribute ** 解决办法
写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...
- AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'
/*************************************************************************** * AttributeError: 'modu ...
- AttributeError: 'dict_values' object has no attribute 'translate'
/***************************************************************************************** * Attribu ...
随机推荐
- 中值滤波C语言优化
中值滤波C语言优化 图像平滑是图像预处理的基本操作,本文首先用不同的方法对一张图片做预处理比较它们效果的不同,然后针对中值滤波,实现了一种快速实现.(其实是copy的opencv实现,呵呵).因为op ...
- 【阿里云产品公测】PTS压力测试最低配ECS性能及评测
PTS是一个性能测试工具,可以使用PTS对自身系统性能在阿里云环境里的状况进行整体评估来找出你的系统性能瓶颈从而优化系统,同时你还可以在了解自己的系统性能指标情况下便于未来新增扩容.在使用PTS前你必 ...
- TextView来实现跑马灯的效果
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...
- 全面了解 NOSQL
NoSQL被我们用得最多的当数key-value存储,想知道为什么要有NOSQL,就首先要明白传统关系SQL: 传统关系数据库的瓶颈 传统的关系数据库具有不错的性能,高稳定型,久经历史考验,而且使用简 ...
- dl +rec
AutoEncoder http://blog.csdn.net/studyless/article/details/70880829
- patch 修改有问题的
diff --git a/include/net/tcp.h b/include/net/tcp.h@@ -1013,8 +1048,13 @@ static inline u32 keepalive ...
- #学习笔记#e2e学习使用(一)
本文仅限于记录本人学习的过程,以及怎么踩的坑,是如何解决的.逻辑肯定是混乱的,有用之处会抽出共通另行发帖. 最终目标:要运用于Vue项目中,进行功能测试甚至自动化测试. 一.e2e概念 理解:end ...
- 6 - 常用模块(os,sys,time&datetime,random,json&picle,shelve,hashlib)
导入模块 想使用 Python 源文件,只需在另一个源文件里执行 import 语句 import module1[, module2[,... moduleN] from语句让你从模块中导入一个指定 ...
- March 2 2017 Week 9 Thursday
The first duty of love is to listen. 爱的首要责任是倾听. Yesterday, I read an article that says a successful ...
- python入门10 循环语句
两种循环: 1 for in 2 while #coding:utf-8 #/usr/bin/python """ 2018-11-03 dinghanhua 循环语句 ...