Search Results

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Search Results

by dj0880 on Tue Aug 08, 2017 8:33 am

Being new to iMacros, I'm attempting to write a macro to process through a search of names.
I've looked at the documentation and search the forum, but didn't find any examples of what I need to do.
Seems like it would be simple to do, but so far, nothing I've tried works. Could be my syntax of just not using the
command correctly.
Here is the issue: after a user logs in, they need to enter a persons last name to do a search on that.
I prompt for the name and store it in var1, that part works okay.
Once I use that in the search, the search sometimes returns maybe 25 or more last name, first name pairs that
might stretch over 7, 8, 9 pages.
The user then negotiates over those pages till they find a match.
Could be anywhere, say it's on page 4.
I then need to capture the results of that exact match and then use that data later one.
This is what I have

PROMPT "Please enter last name name:" !VAR1
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Access/NameSearch/Results ATTR=NAME:TextSearchQuery CONTENT={{!VAR1}}
TAG POS=1 TYPE=BUTTON:SUBMIT FORM=ACTION:/Access/NameSearch/Results ATTR=ID:SearchButton

/* User now is presented with a list, several pages of names that they
must select from

TAG POS=1 TYPE=A ATTR=TXT:2
TAG POS=1 TYPE=A ATTR=TXT:3
TAG POS=1 TYPE=A ATTR=TXT:4

/* After the user finds the correct match, they select it and continue on
with the results of their selection. This is the results from their select
action:

TAG POS=1 TYPE=TD ATTR=TXT:SMITH,<SP>JOHN<SP>A

I've tried a number of solutions, nothing has worked.
Here is one example of what I tried with the select command:

TAG POS=1 TYPE=SELECT FORM=NAME:form1 ATTR=NAME:select1 CONTENT=${{!VAR1}}

I just need to know what the user selected, grab that data and continue on.
Any tips or suggestions would be appreciated.
dj0880
 
Posts: 2
Joined: Tue Aug 08, 2017 8:12 am

Re: Search Results

by chivracq on Tue Aug 08, 2017 10:56 am

dj0880 wrote:Being new to iMacros, I'm attempting to write a macro to process through a search of names.
I've looked at the documentation and search the forum, but didn't find any examples of what I need to do.
Seems like it would be simple to do, but so far, nothing I've tried works. Could be my syntax of just not using the
command correctly.
Here is the issue: after a user logs in, they need to enter a persons last name to do a search on that.
I prompt for the name and store it in var1, that part works okay.
Once I use that in the search, the search sometimes returns maybe 25 or more last name, first name pairs that
might stretch over 7, 8, 9 pages.
The user then negotiates over those pages till they find a match.
Could be anywhere, say it's on page 4.
I then need to capture the results of that exact match and then use that data later one.
This is what I have

Code: Select all
PROMPT "Please enter last name name:" !VAR1
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Access/NameSearch/Results ATTR=NAME:TextSearchQuery CONTENT={{!VAR1}}
TAG POS=1 TYPE=BUTTON:SUBMIT FORM=ACTION:/Access/NameSearch/Results ATTR=ID:SearchButton


/* User now is presented with a list, several pages of names that they
must select from

Code: Select all
TAG POS=1 TYPE=A ATTR=TXT:2
TAG POS=1 TYPE=A ATTR=TXT:3
TAG POS=1 TYPE=A ATTR=TXT:4


/* After the user finds the correct match, they select it and continue on
with the results of their selection. This is the results from their select
action:

Code: Select all
TAG POS=1 TYPE=TD ATTR=TXT:SMITH,<SP>JOHN<SP>A


I've tried a number of solutions, nothing has worked.
Here is one example of what I tried with the select command:

Code: Select all
TAG POS=1 TYPE=SELECT FORM=NAME:form1 ATTR=NAME:select1 CONTENT=${{!VAR1}}


I just need to know what the user selected, grab that data and continue on.
Any tips or suggestions would be appreciated.

CIM...! :mrgreen: (Mention your FCI for me to read, read my Sig..., many Commands are not implemented for all Browsers/Versions...)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6475
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Search Results

by dj0880 on Tue Aug 08, 2017 11:06 am

Microsoft Windows 7 Professional
Microsoft Windows NT 6.1.7601 Service Pack 1
64-bit Operating System
Installed UI Culture: English (United States)
CLR version 4.0.30319.42000
Internet Explorer version 10.0.9200.17609
iMacros Browser version 9.0.5.2613
------------------------------------------------------------
Mozilla Firefox version 54.0.1 (x86 en-US)
--------------------------------------------------------
dj0880
 
Posts: 2
Joined: Tue Aug 08, 2017 8:12 am

Re: Search Results

by chivracq on Tue Aug 08, 2017 11:53 am

dj0880 wrote:
Code: Select all
Microsoft Windows 7 Professional
Microsoft Windows NT 6.1.7601 Service Pack 1
64-bit Operating System
Installed UI Culture: English (United States)
CLR version 4.0.30319.42000
Internet Explorer version 10.0.9200.17609
iMacros Browser version 9.0.5.2613
------------------------------------------------------------
Mozilla Firefox version 54.0.1 (x86 en-US)
--------------------------------------------------------

Okay..., the following "simplified" Format is usually good enough:
iMB v9.0 / IE10 / FF54, Win7-Pro_Eng_x64.

Hum, we don't see many Users anymore using iMB v9.

Not completely clear if you'll be running your Script in iMB9/IE10/FF54...?, and if FF, which Version of the iMacros for FF Add-on you'll be using, v9.0.3 or v8.9.7...?
(v8.9.7 for FF is the "advised" stable Version for FF btw, (and still works in FF v54.0.1), v9.0.3 is a bit buggy and limited compared to v8.9.7...)

OK, good "thing" anyway that you are not using Chrome, one "Solution" I have in mind after reading your Post would be using the OS Clipboard which is not (completely) implemented in iMacros for CR (v8.4.4).

OK, a bit difficult to give some "precise" Advice without seeing the Page(s) and its HTML Structure, but from what I understand, you let the User manually navigate to Page_4, then click on the relevant '2'/'3'/'4' Link which will take them to a next Page where they can select (with the Mouse with Mouse Selection or with a Double or Triple Click) the "SMITH, JOHN A" Content from a Cell in some Table.
Easiest at this point would be to ask the User to Copy that Selection to the OS Clipboard (with Right Click + Copy, or 'Ctrl^c'), and you can then access this Data from your Script with '{{!CLIPBOARD}}'. (... which wouldn't work in iMacros for CR...)

If there is some 'INPUT' Field on that Page, they could paste it always in that same Input Field and you could then extract it back from your Script, but it requires more Actions from the User than simply grabbing it directly from the Clipboard.

If you know that the User will always select the Full Name from always the same 'TD' Field on that Page, then you could extract it directly from your Script, maybe combined with Relative Positioning if there is some other Field in the neighbourhood of the Name Field like some "Name:" Label which is always present (and unique!, or that you can uniquely identify/tag) on the Page.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6475
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Data Extraction and Web Screen Scraping

Who is online

Users browsing this forum: No registered users and 4 guests

-->