zoukankan      html  css  js  c++  java
  • css选择问题

    <div class="col-lg-4 col-md-6 mb-4">
    <div class="card">
    
    <a href="/exercise/list_basic_detail/90008-E/"><img class="card-img-top img-fluid" src="/static/img/90008-E.jpg" alt=""></a>
    
    <div class="card-body">
    <h4 class="card-title">
    <a href="/exercise/list_basic_detail/90008-E/">Short Dress</a>
    </h4>
    <h5>$24.99</h5>
    </div>
    
    </div>
    </div>
    
    css('div .col')选取不到对象,返回空列表
    
    css('div[class*=col]')可以返回对象
    
    or xpath('//div//a[contains(@href,"list")]可以返回,此处注意"list"not'list'双引号
    response.css('.pagination li:nth-child(9)::attr(href)').get() 选区不到href的值,去掉)::attr(href)可以返回到正确的li
    response.css('.pagination li:nth-child(9)').re('href="(.*?)"')可以提取出来,re之后不用加get()
    response.css('.pagination li:nth-child(9)').re('href="(.*?)"')返回是列表,不能直接用response.follow,在
    response.css('.pagination li:nth-child(9)').re('href="(.*?)"')[0]提取出值
    response.css('a[class*=page]:contains("Next")').re('href="(.*?)"')[0]  。。。。contains() will match elements with the desired text block:,后面的“:”要紧跟,不要有空格
    
    
    
     
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- focus on what you want to be
  • 相关阅读:
    mysql存储过程
    mysql sql语句大全(2)
    JavaScript自动关闭窗口
    mvc存储Cookie和读取Cookie方法
    JS正则表达式验证账号、手机号、电话、邮箱、货币
    Have trouble in your life
    微店网
    MVC4使用EF6连接mysql数据库
    asp.net,mvc4,mysql数据库,Ef遇到问题集合
    Python对DICOM图像进行阈值分割
  • 原文地址:https://www.cnblogs.com/bamboozone/p/10423872.html
Copyright © 2011-2022 走看看