关于 '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 ...
随机推荐
- java程序: 从kernel.ubuntu.com下载kernel - HttpURLConnection
用java实现从kernel.ubuntu.com下载内核的小工具 现在的最新的LTS版本是4.19,目前已经更新到4.19.13了. Kernel的更新通知里,经常有下面的陈述: 作为一个听劝的人, ...
- 插入排序——Java实现
一.排序思想 从数组第一个元素开始(0下标),该元素可以认为已经被排序: 取出待排序列中第一个元素,然后从“有序”序列中,从后往前扫描: 如果该元素(有序序列)大于待插入元素(待排序列),将该元素后移 ...
- hiveQL随笔
hiveQL中union all直接用于select 子句
- vue.js练习经验总结
1.最好JSON数据与(模板里 v-bind里绑定的自定义属性不要重名),根据console控制台的提示来看,应该是重名所引起的编译错误 2.还有个很奇怪的问题,局部注册vue的过滤器,到了模板之后不 ...
- Mac安装Gradle eclipse安装buildship插件
一直用的eclipse+mvn,现在需要导入别人的gradle项目,所以下载了gradle和在eclipse中安装了buildship插件. 一,mac下安装gradle 1,点击网页https:// ...
- 某虚拟定位APP从破解到原理分析
工具环境ida7.0iphone 6ios 10.2 0x00:基本情况 1. 该app可以修改模拟手机地理位置(gps.基站.WIFI),拥有全局定位.指定应用定位.模拟扫街等功能,只能在已越狱的I ...
- Android studio 配置使用maven
安装nexus(略) 启动nexus 打开web(admin;admin123) http://127.0.0.1:8081/nexus 创建的demo 1 2 3 对应的本地目录 配置maven / ...
- 将CSV文件中的数据导入到SQL Server 数据库中
导入数据时,需要注意 CSV 文件中的数据是否包含逗号以及双引号,存在时,导入会失败 选择数据库 -> 右键 -> 任务 -> 导入数据 ,然后根据弹出的导入导出向导(如下图)中的提 ...
- python字符串反转 高阶函数 @property与sorted(八)
(1)字符串反转 1倒序输出 s = 'abcde' print(s[::-1]) #输出: 'edcba' 2 列表reverse()操作 s = 'abcde' lt = list(s) lt.r ...
- 【Leetcode】【Easy】Min Stack
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. pu ...