We help IT Professionals succeed at work.

xpath for next set of records in navigation

665 Views
Last Modified: 2015-09-19
xml: Using Webscraper called " Data Miner"

I'm trying to get syntax correct for xpath to automatically navigate to next page.

It is asking me for   "Next Page Element Xpath:"

trying to use this below but it is not working: keeps saying it cant find element

//a[@class='page_numbers']/following-sibling::a[1]


<div class="col-md-12 no-padding pagination-container">
	
		
			<div class="ref-pagination col-md-8 col-lg-9 no-padding pull-right">
				<ul class="pagination pull-right">
					<li class="first">
							
								<a href="javascript:void(0);" class="diabled-anchor"> <span>First</span>
								</a>
							
							
						</li>
					<li class="prev">
							
								<a href="javascript:void(0);" class="diabled-anchor"> <span><</span>
								</a>
							
							
						</li>

					
					
						<li class="page_numbers"><a
							href="NextRecordsReferenced.do?id=1"><strong>1</strong><span
								class="hidden">1</span></a></li>
						
					
						<li class="page_numbers"><a
							href="NextRecordsReferenced.do?id=2"><strong>2</strong><span
								class="hidden">2</span></a></li>
						
					
						<li class="page_numbers"><a
							href="NextRecordsReferenced.do?id=3"><strong>3</strong><span
								class="hidden">3</span></a></li>
						
					
						<li class="page_numbers"><a
							href="NextRecordsReferenced.do?id=4"><strong>4</strong><span
								class="hidden">4</span></a></li>
						
					
						<li class="page_numbers"><a
							href="NextRecordsReferenced.do?id=5"><strong>5</strong><span
								class="hidden">5</span></a></li>
						
					
					<li class="next">
							
								<a href="javascript:void(0);" class="diabled-anchor"> <span>></span>
								</a>
							
							
						</li>
					<li class="last">
							
								<a href="javascript:void(0);" class="diabled-anchor"> <span>Last</span>
								</a>
							
							
						</li>
				</ul>
			</div>
			<div class="col-md-4 col-lg-3 col-sm-12 no-padding pull-left">
				<span class="item_per_label">Items per Page:</span>
				<div class="dropdown display_item_grid pull-left">
					<button class="btn btn-default dropdown-toggle" type="button"
						id="dropdownMenu1" data-toggle="dropdown" aria-expanded="true">
						16 <span class="caret"></span>
					</button>
					<ul class="dropdown-menu" role="menu"
						aria-labelledby="dropdownMenu1">
						<li role="presentation"><a role="menuitem" class="selected"
							tabindex="-1" href="javascript:void(0);">16</a></li>
						<li role="presentation"><a role="menuitem" tabindex="-1"
							href="javascript:void(0);">32</a></li>
						<li role="presentation"><a role="menuitem" tabindex="-1"
							href="javascript:void(0);">48</a></li>
					</ul>
				</div>
			</div>

Open in new window




Thanks
fordraiders
Comment
Watch Question

IT Business Systems Analyst / Software Developer
CERTIFIED EXPERT
Top Expert 2015
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
mccarl,
"But I am also unsure as to if this will even work once you have the right element selected. I'm sure it would work if the link were real links, with URL's to take you to the next page, but it appears that these are just managed javascript which knows how to load the next page. Anyway, I guess you just have to try it and see."

Thanks and yes, it's a managed javascript routine. i think that is my problem.
So  there is not way to get the xpath string to include the routine ?

NextRecordsReferenced.do

Thanks
fordraiders

Author

Commented:
mccarl, Based on the syntax you gave me

I tried this and it worked.

//li[@class='page_numbers']/a

I replaced 'next' with 'page_numbers'

that works..

now when the pagination needs to end in data miner, it goes back to the beginning and starts over.

But thats not your problem.

Thanks
fordraiders
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.