需要使用selenium从源中提取页面ID

时间:2012-01-06 10:11:46

标签: regex selenium

<table width="100%" id="sfc">
<caption>Self Help Center</caption>
<tr><td valign="top">
<tr>
<td width="100%" valign="top">
<a href="http://supportsolutions.ds.adp.com/external/SOAP/webSuite2DealerSuiteLogon.asp? cnumber=C149491&page=doc&PageID=4f052a6906229_TOM" target="_blank" title="Online User Guides" >Online Documentation</a>
</td></tr></table>

我需要提取href值。

1 个答案:

答案 0 :(得分:0)

或:

open | file:///C:/Users/x/Desktop/page.html

storeHtmlSource | source

store | 0 | delimiter0

store | 1 | delimiter1

store | javascript{storedVars['source'].split('href="')[storedVars['delimiter1']]} | href0

store | javascript{storedVars['href0'].split('\"')[storedVars['delimiter0']]} | href1