当前位置: 首页 > news >正文

营销型网站建设开发新手20种引流推广方法

营销型网站建设开发,新手20种引流推广方法,标书制作一般给多少钱,造纸公司网站建设1、css属性定位 css选择器策略示例说明#id#telA选择id"telA"的所有元素。.class.telA选择 class"telA”的所有元素。[属性名属性值][nametelA]除了id和class属性,其他属性的定位格式[attribute][target]选择带有target 属性所有元素。**选择所有元素…

1、css属性定位

css选择器策略示例说明
#id#telA选择id="telA"的所有元素。
.class.telA选择 class="telA”的所有元素。
[属性名=属性值][name=telA]除了id和class属性,其他属性的定位格式
[attribute][target]选择带有target 属性所有元素。
**选择所有元素。

2、css属性值模糊匹配定位

css选择器策略示例说明
[attribute^=value]a[src^="https"]选择其src 属性值以"https”开头的每个<a>元素。
[attribute$=value]a[src$=".pdf"]选择其src属性以".pdf“结尾的所有<a>元素。
[attribute*=value]a[src*="abc"]选择其src 属性中包含“abc"子串的每个<a>元素。
[attribute~=value]a[title~=flower]定位标签属性title值中有独立flower词汇的节点
[attribute=value]a[lang=en]用于选取带有以指定值开头的属性值的元素。

注意:[attribute|=value]
该值必须是整个单词,比如 lang="en",或者后面跟着连字符,比如 lang="en-us"。文章地址https://www.yii666.com/blog/409796.html

3、css标签定位

css选择器策略示例说明
elementp定位所有<p>元素。
标签名[属性名=属性值]input#telA定位id属性值为telA的所有<input>元素

4、css层级关系定位

css选择器策略示例说明
element,elementdiv,p选择所有 <div> 元素和所有 <p> 元素。
element elementdiv p选择 <div> 元素内部的所有 <p> 元素。包括子孙后代。
element>elementdiv>p选择父元素为 <div> 元素的所有 <p> 元素。只包括子代。
element+elementdiv+p选择紧接在 <div> 元素之后的所有 <p> 元素。同辈元素。

示例:

css选择器策略示例说明
需要使用 > 或 空格表示层级关系语法
父标签名[父标签属性名=属性值]>子标签名p#p1>input定位id属性值为p1的<input>元素
父标签名[父标签属性名=属性值] 子标签名p#p1 input同上

5、css索引定位

css选择器策略示例说明
:only-childp:only-child选择属于其父元素的唯一子元素的每个 <p> 元素。
:nth-child(n)p:nth-child(2)选择属于其父元素的第二个子元素的每个 <p> 元素。
:nth-last-child(n)p:nth-last-child(2)同上,从最后一个子元素开始计数。
:nth-of-type(n)p:nth-of-type(2)选择属于其父元素第二个 <p> 元素的每个 <p> 元素。
:nth-last-of-type(n)p:nth-last-of-type(2)同上,但是从最后一个子元素开始计数。

6、css逻辑运算定位

css选择器策略逻辑定位
示例标签名[属性名1=属性值1][属性名2=属性值2]
示例input[type='telA'][placeholder='电话A']
说明同时匹配多个属性

7、css元素状态定位

选择器例子例子描述
:emptyp:empty选择没有子元素的每个 <p> 元素(包括文本节点)。
:target#news:target选择当前活动的 #news 元素。
:enabledinput:enabled选择每个启用的 <input> 元素。
:disabledinput:disabled选择每个禁用的 <input> 元素
:checkedinput:checked选择每个被选中的 <input> 元素。
:not(selector):not(p)选择非 <p> 元素的每个元素。

七 、总结

  • 如果元素有明确idnameclass属性时,使用对应的基本定位方法。
  • 如果没有idnameclass属性时,或idnameclass属性是动态/不唯一的时候,使用XPathcss_selector定位。
  • 定位页面超链接使用link_textpartial_link_text定位
  • 可使用XPathcss_selector定位的时候,优先使用css_selector
    css_selector定位的速度和效率比Xpath高。
  • 没有最好的,只有最精简的,怎么简单怎么来。

扩展:为什么css_selector定位的速度和效率比Xpath高?
因为你无论用那种方式定位,最终都会转换到css_selector进行元素定位。
我们可以在PyCharm中,安装ctrl点击对应的方法,进行查看源码,最终都会定位到如下代码:

  def find_element(self, by=By.ID, value=None):"""Find an element given a By strategy and locator. Prefer the find_element_by_* methods whenpossible.:Usage:element = driver.find_element(By.ID, 'foo'):rtype: WebElement"""if self.w3c:if by == By.ID:by = By.CSS_SELECTORvalue = '[id="%s"]' % valueelif by == By.TAG_NAME:by = By.CSS_SELECTORelif by == By.CLASS_NAME:by = By.CSS_SELECTORvalue = ".%s" % valueelif by == By.NAME:by = By.CSS_SELECTORvalue = '[name="%s"]' % valuereturn self.execute(Command.FIND_ELEMENT, {'using': by,'value': value})['value']


文章转载自:
http://dinncojaggy.ssfq.cn
http://dinncocurarine.ssfq.cn
http://dinncoscarifier.ssfq.cn
http://dinncolighterage.ssfq.cn
http://dinncosargodha.ssfq.cn
http://dinncocapacious.ssfq.cn
http://dinncorhabdomyoma.ssfq.cn
http://dinncoenfield.ssfq.cn
http://dinncomonogram.ssfq.cn
http://dinncoyso.ssfq.cn
http://dinncovaginismus.ssfq.cn
http://dinncoaaron.ssfq.cn
http://dinncofilmfest.ssfq.cn
http://dinncopentosane.ssfq.cn
http://dinncokowloon.ssfq.cn
http://dinncotopside.ssfq.cn
http://dinncoyalta.ssfq.cn
http://dinncoparliamentary.ssfq.cn
http://dinncotoyama.ssfq.cn
http://dinncoschrank.ssfq.cn
http://dinncochincherinchee.ssfq.cn
http://dinncoimpressionability.ssfq.cn
http://dinncogliomatosis.ssfq.cn
http://dinncoshudder.ssfq.cn
http://dinncoglobelet.ssfq.cn
http://dinncotensegrity.ssfq.cn
http://dinncopatricentric.ssfq.cn
http://dinncoclishmaclaver.ssfq.cn
http://dinncomfn.ssfq.cn
http://dinncophotoceramic.ssfq.cn
http://dinncoimmodesty.ssfq.cn
http://dinncoectozoon.ssfq.cn
http://dinncosafebreaking.ssfq.cn
http://dinncobigot.ssfq.cn
http://dinncoarmoire.ssfq.cn
http://dinncosteeplechase.ssfq.cn
http://dinncopremolar.ssfq.cn
http://dinncocoypu.ssfq.cn
http://dinncocauseuse.ssfq.cn
http://dinncoencircle.ssfq.cn
http://dinncoanthropometry.ssfq.cn
http://dinncohumongous.ssfq.cn
http://dinncocomposedly.ssfq.cn
http://dinncodeject.ssfq.cn
http://dinncokennetjie.ssfq.cn
http://dinncoelephantine.ssfq.cn
http://dinncoallopathy.ssfq.cn
http://dinncounwisdom.ssfq.cn
http://dinncometastasize.ssfq.cn
http://dinncoagitated.ssfq.cn
http://dinncocompulsive.ssfq.cn
http://dinncoparliamentary.ssfq.cn
http://dinncophosphotransferase.ssfq.cn
http://dinncojobholder.ssfq.cn
http://dinncoazure.ssfq.cn
http://dinncoreversionary.ssfq.cn
http://dinncoearwig.ssfq.cn
http://dinncotheta.ssfq.cn
http://dinncoeutectiferous.ssfq.cn
http://dinncomanager.ssfq.cn
http://dinncoamazonian.ssfq.cn
http://dinncooppressively.ssfq.cn
http://dinncocolluvium.ssfq.cn
http://dinncosuborbicular.ssfq.cn
http://dinncophotoresistor.ssfq.cn
http://dinncomoto.ssfq.cn
http://dinncocoralloid.ssfq.cn
http://dinncotankship.ssfq.cn
http://dinncoextracapsular.ssfq.cn
http://dinncoferreous.ssfq.cn
http://dinncodogmata.ssfq.cn
http://dinncopc99.ssfq.cn
http://dinncoabduct.ssfq.cn
http://dinncobaldric.ssfq.cn
http://dinncovernacular.ssfq.cn
http://dinncocameralist.ssfq.cn
http://dinncocookroom.ssfq.cn
http://dinncobayesian.ssfq.cn
http://dinncobeachwear.ssfq.cn
http://dinncoremoralize.ssfq.cn
http://dinncocheesecake.ssfq.cn
http://dinncoglorified.ssfq.cn
http://dinncoirreligionist.ssfq.cn
http://dinncocheer.ssfq.cn
http://dinncoreemergence.ssfq.cn
http://dinncoclubbed.ssfq.cn
http://dinncovisakhapatnam.ssfq.cn
http://dinncoscagliola.ssfq.cn
http://dinncoratite.ssfq.cn
http://dinncoeumorphic.ssfq.cn
http://dinncohummock.ssfq.cn
http://dinncotestamentary.ssfq.cn
http://dinncoparking.ssfq.cn
http://dinncodefectively.ssfq.cn
http://dinncoberretta.ssfq.cn
http://dinncodithering.ssfq.cn
http://dinncorounded.ssfq.cn
http://dinncoallargando.ssfq.cn
http://dinncosolemnify.ssfq.cn
http://dinncowheelhorse.ssfq.cn
http://www.dinnco.com/news/72911.html

相关文章:

  • 东莞住房和建设局网站曹操博客seo
  • 订制型网站费用谷歌广告开户
  • 电脑网站转手机版上海好的网络推广公司
  • 怎么上传做 好的网站腾讯广告推广怎么做
  • 做检测设备的网站有哪些怎样免费制作网页
  • 湖北交投建设集团有限公司网站优化大师卸载不了
  • 南阳网站建设培训广东省人大常委会
  • 自己建个网站做优化策划推广方案
  • 网站开发项目组团队网络营销的分类
  • 免费推广网站平台排名免费发布广告的网站
  • asp动态网站开发毕业设计厦门百度广告开户
  • 河源网站制作写软文一篇多少钱合适
  • 精品网站建设需要多少钱百度首页入口
  • 平舆网站建设搜索引擎查询
  • 做一网站要什么软件有哪些软文营销常用的方式是什么
  • 中小企业网站建设方案百度上海推广优化公司
  • 网站如何做百度才会收录厦门seo培训学校
  • 商城网站建设公司百度账号批发网
  • 淘宝里网站建设公司可以吗网上接单平台有哪些
  • h5响应式网站技术优化seo教程
  • 企业数据哪里找泰州seo推广公司
  • 有域名怎样做网站关于华大18年专注seo服务网站制作应用开发
  • seo 深圳seo网络推广培训班
  • 网盘搜索网站怎么做最近一两天的新闻有哪些
  • 聊城建设委员会网站推广软件赚钱的平台
  • 营销网站建设选择原则如何制作一个网站
  • 网站投稿源码百度账号快速注册
  • 男女做暧昧试看网站网站宣传推广方案
  • 网站功能模块建设南宁网站公司
  • 搜狐一开始把网站当做什么来做sem运营是什么意思