Python中文
首页
教程
问答
标签
搜索
登录
注册
如何根据以前的标记类值删除标记?
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>如何根据以前的标记类值删除标记?你知道吗</p> <p><strong>输入</strong>:</p> <pre><code><html> <body> <div> <p id="quarter-line-below1"><span class="dropcap-image-qc ><img alt="2014" src="243864_20.png" /></span><span class="dropcap-qc">2014 </span>has had some strange and negative commentary about publishing with HTML5. The comments appear to be focused on HTML for trade fiction books and the requirements of publishing genres beyond simple narratives seems to be ignored.</p> </div> </body> </html> </code></pre> <p>我必须删除所有包含<code>dropcap-qc</code>的标签,即<code><span class="dropcap-qc">2014 </span></code></p> <p>一切都结束了。你知道吗</p> <p>XSL代码:</p> <pre><code><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="no"/> <xsl:preserve-space elements="*"/> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> <xsl:template match="//*[@class='dropcap-qc']"></xsl:template> </xsl:stylesheet> </code></pre> <p>我正在用Python代码创建上面的XSL。我得到所有已删除的标记类名,然后创建XSL。你知道吗</p> <p>获取类名的代码:<a href="https://stackoverflow.com/questions/30482435/how-to-get-count-of-every-column-value-of-table">https://stackoverflow.com/questions/30482435/how-to-get-count-of-every-column-value-of-table</a></p> <p>我不太懂XSL。你知道吗</p> <p><strong>我的问题是,我想删除所有<code>dropcap-qc</code>标签,但这应该是<code>dropcap-image-qc</code>标签的下一个标签。</strong></p> <p>有人能帮我找到正确的xpath吗?你知道吗</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<blockquote> <p>Can anyone help me to get correct xpath?</p> </blockquote> <p>chrome扩展<a href="http://selectorgadget.com/" rel="nofollow">Selector Gadget</a>使得获得xpath非常容易。只需单击一个元素(或一组元素),它就会生成XPath或CSS选择器。你知道吗</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
Python中两个字典的交集
1 回答
python中两个字符串上的异或操作数?
4 回答
Python中两个字符串中的类似句子
8 回答
Python中两个字符串之间的Hamming距离
4 回答
python中两个字符串之间的匹配模式
6 回答
python中两个字符串之间的按位或
2 回答
python中两个字符串之间的数据(字节)切片
8 回答
python中两个字符串之间的模式
2 回答
python中两个字符串作为子字符串的区别
5 回答
Python中两个字符串元组的比较
6 回答
Python中两个字符串列表中的公共字符串
1 回答
python中两个字符串的Anagram测试
7 回答
Python中两个字符串的正则匹配
5 回答
python中两个字符串的笛卡尔乘积
4 回答
Python中两个字符串相似性的比较
7 回答
python中两个字符串语义相似度的求法
3 回答
Python中两个字符置换成固定长度的字符串,每个字符的数目相等
6 回答
Python中两个对数方程之间的插值和平滑数据
5 回答
Python中两个对象之间的And/Or运算符
5 回答
python中两个嵌套字典中相似键的和值
8 回答