Relative Positioning Problem

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Randize
Posts: 2
Joined: Sun Apr 27, 2014 11:14 am

Relative Positioning Problem

Post by Randize » Sun Apr 27, 2014 11:43 am

I'm trying to extract text which contain from all the child of the list. The format of the code is as below:

Code: Select all

<ul class="List">
<li class="" data-index="0">
	<div class="comment">
 		<div class="description">
			<a class=""></a>
			<div class="name">
				<div class="wrapper">
					<a class="classToBeExtracted">Text I want to extract</a>
				</div>
			</div>
		</div>
	</div>
</li>
<li class="" data-index="1"></li>
<li class="" data-index="2"></li>
<li class="" data-index="3"></li>
</ul>

<ul class="List">
<li class="" data-index="1"></li>
<li class="" data-index="2"></li>
<li class="" data-index="3"></li>
</ul>

<ul class="List">
<li class="" data-index="1"></li>
<li class="" data-index="2"></li>
<li class="" data-index="3"></li>
</ul>
I write my code in Javascript but my imacros looks something like:

Code: Select all

extractCommentor += "TAG POS=1 TYPE=UL ATTR=List" + "\n";
extractCommentor += "TAG POS=R" + cNum + " TYPE=A ATTR=CLASS:classToBeExtracted EXTRACT=TXT" + "\n";
Unless I'm using relative positioning the wrong way, I think iMacros has bug Tagging the right relative position. In my case, it doesn't tag from the 1st UL but jumps to get the Extract from all over the other UL.

Please let me know if this need more clarification, otherwise, can anyone verify that I'm doing the right way in using the relative positiong? Anyway I can sovle this?
Randize
Posts: 2
Joined: Sun Apr 27, 2014 11:14 am

Re: Relative Positioning Problem

Post by Randize » Sun Apr 27, 2014 1:47 pm

I found out the problem which is stated here. http://forum.imacros.net/viewtopic.php? ... 530#p16530

Unfortunately the search begins after the closing of an anchor, so relative positiong doesn't work in nested elements.

And in my example, there's no way I can tag anything to get use relative positioning, any other solution to this?
chivracq
Posts: 9494
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Relative Positioning Problem

Post by chivracq » Sun Apr 27, 2014 4:44 pm

Full Config Info missing...

Any chance you can post the URL of the Page you are trying to interact with...?, or a Full HTML Saveas of the Page...? (I'm not fluent at looking at just "pure" HTML Source...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
skippyto
Posts: 108
Joined: Wed Aug 20, 2008 8:14 am

Re: Relative Positioning Problem

Post by skippyto » Wed May 14, 2014 2:24 pm

Hi

Not sure of what you want to do, but i think you'd better use the LI tag instead of the UL tag and loop on this tag :

Code: Select all

extractCommentor += "TAG POS=" + cNum + " TYPE=LI ATTR=class:\"\"" + "\n";
extractCommentor += "TAG POS=R1 TYPE=A ATTR=CLASS:classToBeExtracted EXTRACT=TXT" + "\n";
Skippyto
Post Reply