contact  |  about  |  sitemap

Mix and Match Data
Last Post 14 Jun 2009 11:44 AM by Expendable. 3 Replies.
Sort:
PrevPrev NextNext
Author Messages
expendable

--
07 Jun 2009 08:44 AM
Is there a way to add a function in a loop where it only searches for a specific variable "before" another specified variable

Loop Between (Variable 1) & (Variable 2)

Say for example there are several codes variables used in a set a pages, however each data set has different variations of the variables. If this were on separate pages, you could run a simple loop, but on a single page the loop does not work.


Copy Text Between "Tel:" and </b>
Copy Text Between "Phone:" and </b> (skips link 2)
Copy Text Between "Cellular:" and </b>
Copy Text Between "Toll-Free:" and </b> (not found)
Copy Text Between "Fax:" and </b> (missed Tel in 5)


<LI>Link 1:</LI>

<b>Tel: 123-456-789</b>
<b>Fax: 123-456-789</b>

<LI>Link 2:</LI>

<b>Tel: 123-456-789</b>
<b>Toll-Free: 123-456-789</b>
<b>Fax: 123-456-789</b>

<LI>Link 3:</LI>

<b>Phone: 123-456-789<b>
<b>Toll-Free: 123-456-789</b>
<b>Fax: 123-456-789</b>

<LI>Link 4:</LI>

<b>Celluar: 123-456-789</b>

<LI>Link 5:</LI>
<b>Tel: 123-456-789</b>
<b>Fax: 123-456-789</b>


-=-

Setting a Loop Between the constant variable "<LI> and next <LI>" would work, but I can't figure out how to do that.

Any suggestions?



expendable

--
08 Jun 2009 07:32 AM
I think misquoted the problem... that loop can be done easily by

Copy Text between <LI> and </LI> into variable LI
Copy Rest

Loop LI if NOT Empty
Copy Text between <LI> and </LI> into variable LI
Copy Rest
End Loop

but what I want is a loop that searches BETWEEN the loop, rather than in order.

So if "Tel:" comes before "Fax:" in one instance and "Fax:" comes before "Tel:" in another the script would gather the data no matter what the order.

The end result would be a search within function to search only inside <LI> and NEXT <LI>

Possible?


Tijn

--
10 Jun 2009 12:10 PM
Hi,

I think you should use the copy text between from source to extract the LI content and put that in a variable snippet for example.

Next you use the copy text between action (that does not remember it's cursor position) to copy the fax, tel, etc from the snippet variable.

That way is does not matter in what order the tel and fax are placed.
Also incomplete records won't matter anymore.

There is example 9 included with the Djuggler setup that does exactly the same only with tables instead of LI tags.

Tijn

Collect_web_data_from_a_web_page_that_has_diff.djs

Expendable

--
14 Jun 2009 11:44 AM
Sounds perfect, will definitely be adding this routine to my macros.. Thanks Tijn!




Quick Reply
toggle
  Username:
Subject:
Body:
Security Code:
Enter the code shown above:

Submit

Powered by Active Forums

Forum participation and optional registration

You don't need to be registered to partcipate in the Djuggler forums, however if you want to subscribe to email notifications you need to register. You can also subscribe to the forum RSS feed.