Dear friends,
I try to find the forward and backward content of a play list . The main item is identified using <h1> tag ...
I wrote a code for forward item which works fine as below:
but in reverse my code fails as shown below:
Please advise with a solution fast
Thanks
Anes
I try to find the forward and backward content of a play list . The main item is identified using <h1> tag ...
I wrote a code for forward item which works fine as below:
Code:
if(direction == "forward"): counter = 0 for i in range(self.pos_indice,len(self.indice)): if(self.indice[i+1].tagName == "h1"): break else: counter = counter+1 return counter+1
but in reverse my code fails as shown below:
Code:
if(direction == "backword"): rev_counter = self.pos_indice for j in range(self.pos_indice,0,-1): if(self.indice[j+1].tagName == "h1"): break else: rev_counter = rev_counter + 1 return rev_counter+1
Thanks
Anes
Comment