在属性中使用循环:txt循环遍历多个页面

时间:2016-08-31 22:17:08

标签: loops web-scraping imacros

我正在尝试使用此IMacros点击并下载大量房地产销售。 “TAG POS = 2 TYPE = A ATTR = TXT:2”是我点击以显示更多列表的按钮,并且是您单击1,2,3,...等的菜单之一。去不同的页面。有没有办法设置循环来循环浏览这些页面? (txt标签就是它。)

VERSION BUILD=844 RECORDER=CR
URL GOTO=http://chicagotribune.public-record.com/realestate/search/cook
TAG POS=1 TYPE=FIELDSET FORM=ID:theForm ATTR=TXT:Required<SP>Search<SP>ParametersInput<SP>Date<SP>(mm/dd/yyyy*
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:theForm ATTR=NAME:sdate CONTENT=01/01/2003
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:theForm ATTR=NAME:edate CONTENT=12/31/2005
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:theForm ATTR=NAME:submit
TAG POS=2 TYPE=TABLE ATTR=ID:"dataTable" EXTRACT=TXT
TAG POS=2 TYPE=A ATTR=TXT:2
TAG POS=2 TYPE=TABLE ATTR=ID:"dataTable" EXTRACT=TXT
TAG POS=2 TYPE=A ATTR=TXT:3

1 个答案:

答案 0 :(得分:0)

当然!首先在通常模式下播放以下宏:

URL GOTO=http://chicagotribune.public-record.com/realestate/search/cook
TAG POS=1 TYPE=FIELDSET FORM=ID:theForm ATTR=TXT:Required<SP>Search<SP>ParametersInput<SP>Date<SP>(mm/dd/yyyy*
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:theForm ATTR=NAME:sdate CONTENT=01/01/2003
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:theForm ATTR=NAME:edate CONTENT=12/31/2005
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:theForm ATTR=NAME:submit

然后以循环模式播放这个:

TAG POS=2 TYPE=TABLE ATTR=ID:"dataTable" EXTRACT=TXT
SET page EVAL({{!LOOP}}+1)
TAG POS=2 TYPE=A ATTR=TXT:{{page}}