2016-07-25 79 views
-1

我想提取數據:姓名,電子郵件,電話,日期,城市
這裏的HTML代碼示例:iMacros如何在不具有元素屬性的情況下提取數據?

<tbody> 
    <tr class="grid-row"> 
      <td>Jimmy Shark</td> 
      <td>[email protected]</td> 
      <td>082166883333</td> 
      <td>07/13/15, 07:23 AM</td> 
      <td></td> 
     </tr> 
    <tr class="odd grid-row"> 
      <td>Denny Large</td> 
      <td>[email protected]</td> 
      <td>08575510121</td> 
      <td>07/09/16, 11:55 PM</td> 
      <td></td> 
    </tr> 
    <more and repeated> 
</tbody> 

回答

0

開始與下面的宏和糾正,以滿足您的目標:

SET !ERRORIGNORE YES 
SET !TIMEOUT_STEP 0 
SET !EXTRACT_TEST_POPUP NO 

TAG XPATH="//tr[@class='grid-row'][{{!LOOP}}]/td[1]" EXTRACT=TXT 
TAG XPATH="//tr[@class='grid-row'][{{!LOOP}}]/td[2]" EXTRACT=TXT 
TAG XPATH="//tr[@class='grid-row'][{{!LOOP}}]/td[3]" EXTRACT=TXT 
TAG XPATH="//tr[@class='grid-row'][{{!LOOP}}]/td[4]" EXTRACT=TXT 
TAG XPATH="//tr[@class='grid-row'][{{!LOOP}}]/td[5]" EXTRACT=TXT 
PROMPT {{!EXTRACT}} 
SET !EXTRACT NULL 

TAG XPATH="//tr[@class='odd grid-row'][{{!LOOP}}]/td[1]" EXTRACT=TXT 
TAG XPATH="//tr[@class='odd grid-row'][{{!LOOP}}]/td[2]" EXTRACT=TXT 
TAG XPATH="//tr[@class='odd grid-row'][{{!LOOP}}]/td[3]" EXTRACT=TXT 
TAG XPATH="//tr[@class='odd grid-row'][{{!LOOP}}]/td[4]" EXTRACT=TXT 
TAG XPATH="//tr[@class='odd grid-row'][{{!LOOP}}]/td[5]" EXTRACT=TXT 
PROMPT {{!EXTRACT}} 
+0

oke work Shugar和我完成它保存在CSV文件..問題如何這個宏可以運行旁邊的頁面和更多的頁面,像這樣的鏈接 http://member.googlee.net/afleads?_al_p = 0 http://member.googlee.net/afleads?_al_p=1 http://member.googlee.net/afleads?_al_p=2 http://member.googlee.net/afleads?_a l_p = ....接下來的下一個直到完成或可以設置,直到33頁...如果宏變成javasript oke沒問題..謝謝Shugar –

+0

你可以從我的答案[這裏](http:// stackoverflow。 com/questions/38422883/regular-imacros-transform-into-javascript-but-still-not-work)。 – Shugar

相關問題