我是在写爬虫是遇到了这个问题:

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'的更多相关文章

  1. 'module' object has no attribute 'select'

    和tensorflow的版本有关系 新版本 将tf.select替换为tf.where

  2. Python AttributeError: 'Module' object has no attribute 'STARTF_USESHOWINDOW'

    夫学须志也,才须学也,非学无以广才,非志无以成学.--诸葛亮 生活有度,自得慈铭 --杜锦阳 今天新来的同事安装环境遇到个莫名其妙的问题: AttributeError: 'Module' objec ...

  3. pyspark AttributeError: 'NoneType' object has no attribute 'setCallSite'

    pyspark: AttributeError: 'NoneType' object has no attribute 'setCallSite' 我草,是pyspark的bug.解决方法: prin ...

  4. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  5. AttributeError: 'list' object has no attribute 'write_pdf'

    我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...

  6. AttributeError: '_csv.reader' object has no attribute 'next'

    我在使用pyhon3.4运行以下代码时报错:AttributeError: '_csv.reader' object has no attribute 'next' import csv import ...

  7. attributeError:'module' object has no attribute ** 解决办法

    写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...

  8. AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'

    /*************************************************************************** * AttributeError: 'modu ...

  9. AttributeError: 'dict_values' object has no attribute 'translate'

    /***************************************************************************************** * Attribu ...

随机推荐

  1. Facebook 爬虫

    title: Facebook 爬虫 tags: [python3, facebook, scrapy, splash, 爬虫] date: 2018-06-02 09:42:06 categorie ...

  2. The nineteenth day

    Twinkle,twinkle,little start! 闪烁,闪烁,小星星 How I wonder what you are, 我想知道你是什么 Up above the world so hi ...

  3. Vue2.0+Node.js+MongoDB全栈打造商城系统

    vue.js +axios mock数据 在main.js中 import axios from 'axios' Vue.prototype.$ajax = axios webpack.dev.con ...

  4. jQuery可调整表和列宽插件-colResizable

    最基本的例子 引入JS <script src="js/jquery-1.8.0.min.js" type="text/javascript">&l ...

  5. Android layout 布局 属性详解

    第一类:属性值 true或者 false           android:layout_centerHrizontal 水平居中     android:layout_centerVertical ...

  6. IntelliJ IDEA搭建SpringBoot的小Demo

    首先简单介绍下Spring Boot,来自度娘百科:Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程.该框架使用了特定的方式来进 ...

  7. aiohttp模块1 client

    Make a Request import aiohttp async with aiohttp.ClientSession() as session: async with session.get( ...

  8. supersocket 通过配置文件启动服务 总是 初始化失败的 解决办法

    <serverTypes> <add name="APPServerType" type="TMPServer.APP.APPServer, TMPSe ...

  9. Nginx+Tomcat在Windows下做负载均衡

    一. 为什么需要对Tomcat服务器做负载均衡 Tomcat服务器作为一个Web服务器,其并发数在300-500之间,如果有超过500的并发数便会出现Tomcat不能响应新的请求的情况,严重影响网站的 ...

  10. dede如何调用一级栏目和子集栏目及其文章

    {dede:channelartlist row=6} <a href='{dede:field name='typeurl'/}'>{dede:field name='typename' ...