Imacro javascript提取和删除不需要的文本

时间:2017-02-12 14:09:01

标签: javascript imacros

这是我要提取的代码:

<*span class='updated'>This user has a bodyguard named <a href='viewprofile.php?username=Username'><b*>Username<*b><*a>!
You must kill them before you can kill <* href='viewprofile.php?username=Username2'><*b>Username2<*b><*a>!<*span>

要提取此信息,请使用以下代码:

macro_var+="TAG POS=1 TYPE=span ATTR=CLASS:updated EXTRACT=TXT\n";

提取此内容:

This user has a bodyguard namedThis user has a bodyguard namedThis user has a bodyguard namedusername!
You must kill them before you can killThis user has a bodyguard namedThis user has a bodyguard namedThis user has a bodyguard namedusername!
You must kill them before you can killThis user has a bodyguard namedThis user has a bodyguard namedThis user has a bodyguard namedusername!
You must kill them before you can killusername2!

我想要提取的只是&lt; b&gt;&lt; / b&gt;

中间的“用户名”

1 个答案:

答案 0 :(得分:0)

&#39; XPATH&#39;表达可能对你有所帮助:

"positionClass"