• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 11:47
CEST 17:47
KST 00:47
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL50Weekly Cups (June 23-29): Reynor in world title form?12FEL Cracov 2025 (July 27) - $8000 live event16Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
The GOAT ranking of GOAT rankings The SCII GOAT: A statistical Evaluation How does the number of casters affect your enjoyment of esports? Statistics for vetoed/disliked maps Esports World Cup 2025 - Final Player Roster
Tourneys
Master Swan Open (Global Bronze-Master 2) RSL: Revival, a new crowdfunded tournament series [GSL 2025] Code S: Season 2 - Semi Finals & Finals $5,100+ SEL Season 2 Championship (SC: Evo) FEL Cracov 2025 (July 27) - $8000 live event
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Player “Jedi” cheat on CSL Unit and Spell Similarities Help: rep cant save Flash Announces Hiatus From ASL
Tourneys
[BSL20] Grand Finals - Sunday 20:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile What do you want from future RTS games? Beyond All Reason
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Trading/Investing Thread The Games Industry And ATVI
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion 2024 - 2025 Football Thread NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 743 users

XPath / Autopager Question

Blogs > JeeJee
Post a Reply
Normal
JeeJee
Profile Blog Joined July 2003
Canada5652 Posts
Last Edited: 2009-12-08 03:32:24
December 08 2009 03:29 GMT
#1
Hiyo~
Long story short, I recently found out about Autopager firefox addon and am trying to get it to work with TL. Unfortunately I have zero XPath experience, so here's where you guys come in =D

Autopager is basically an addon that, for multi-page websites, lets you scroll down to the bottom, and automatically load the next page as part of current html, so you essentially get infinite scrolling (kind of like the All link but on-demand)

To do this it needs 2 things: the url pattern and what to load. The second part is easy, the first one I'm having trouble with..

Here's the default script it presents me with
//a[@title='Next Page (2)' and (text()='Next')]

It basically looks for a link whose Alt Text is Next Page (2) and text is Next and is a subset of http://www.teamliquid.net/forum/viewmessage.php? This works well for the first page and doesn't work for any other page, because the Alt Txt becomes Next Page (3) for the second page, Next Page (4) for the third page, etc

I'm trying to use the starts-with function so that it essentially works like "@title starts-with 'Next Page' and text is Next" but can't figure it out. I got something like
//a[starts-with(@title, 'Next Page') and (text()='Next')]
but it's not working because I think it doesn't link @title to the link.. not sure.

Any experts here? =D

+ Show Spoiler +
Alternatively maybe those Alt Txts could just be changed to say Next Page? ^_^


(\o/)  If you want it, you find a way. Otherwise you find excuses. No exceptions.
 /_\   aka Shinbi (requesting a name change since 27/05/09 ☺)
Elemenope
Profile Blog Joined March 2006
Burkina Faso1704 Posts
December 08 2009 03:52 GMT
#2
Sup jeejee ze
In DotA you could
Nitrogen
Profile Blog Joined February 2008
United States5345 Posts
December 08 2009 03:53 GMT
#3
hey jeejee, i can't really help you with this, but if i know one thing for certain, it's that your name is jeejee.
UNFUCK YOURSELF
geegee1
Profile Blog Joined April 2009
United States618 Posts
December 08 2009 03:56 GMT
#4
hey hey my name is geegee1 LOLOL
pew pew
Nitrogen
Profile Blog Joined February 2008
United States5345 Posts
December 08 2009 03:57 GMT
#5
what the fuck
UNFUCK YOURSELF
Elemenope
Profile Blog Joined March 2006
Burkina Faso1704 Posts
December 08 2009 03:57 GMT
#6
wow are you fucking serious ze?
In DotA you could
SonuvBob
Profile Blog Joined October 2006
Aiur21549 Posts
December 08 2009 04:03 GMT
#7
Maybe try 'Next Page (*)'?
Administrator
Elemenope
Profile Blog Joined March 2006
Burkina Faso1704 Posts
December 08 2009 04:06 GMT
#8
Bob is such a silly silly person ze
In DotA you could
SonuvBob
Profile Blog Joined October 2006
Aiur21549 Posts
December 08 2009 04:15 GMT
#9
Keep the trash in the dota thread ze
Administrator
onmach
Profile Blog Joined March 2009
United States1241 Posts
December 08 2009 04:26 GMT
#10
This works:

//a[text() = 'Next' and contains(@title, 'Next Page')]


A bit more thorough:
//a[text() = 'Next' and contains(@title, 'Next Page') and contains(@href, 'viewmessage')]
JeeJee
Profile Blog Joined July 2003
Canada5652 Posts
Last Edited: 2009-12-08 04:29:22
December 08 2009 04:28 GMT
#11
On December 08 2009 13:03 SonuvBob wrote:
Maybe try 'Next Page (*)'?


the quotes seem to be treating it as a literal asterisk rather than a regex symbol
i tried \* and then i tried separating .. made a typo and it worked
//a[@title='Next Page ('=*+')' and (text()='Next')]


no idea why this works. i meant to put +'s on both sides, but that doesn't work.
oh well whatever, problem fixed =D

but onmach's solution is cleaner and i'll be using that instead
tyvm ^_^
(\o/)  If you want it, you find a way. Otherwise you find excuses. No exceptions.
 /_\   aka Shinbi (requesting a name change since 27/05/09 ☺)
Elemenope
Profile Blog Joined March 2006
Burkina Faso1704 Posts
December 08 2009 04:29 GMT
#12
WHERE'S THE SUP BACK JEEJEE, WHERE IS IT ZE?
In DotA you could
onmach
Profile Blog Joined March 2009
United States1241 Posts
December 08 2009 04:35 GMT
#13
This is an awesome extension, by the way. Thanks for the tip.
JeeJee
Profile Blog Joined July 2003
Canada5652 Posts
December 08 2009 04:36 GMT
#14
oh why the devil are blogs coded differently
good thing it's just one extra line <3

and @ dota guys
this isn't the dota thread, i believe there are standards on TL re: posting outside that thread
and i'm still shinbi you jerkwads.
(\o/)  If you want it, you find a way. Otherwise you find excuses. No exceptions.
 /_\   aka Shinbi (requesting a name change since 27/05/09 ☺)
Elemenope
Profile Blog Joined March 2006
Burkina Faso1704 Posts
December 08 2009 04:41 GMT
#15
Then why is charliemurphy able to post ze
In DotA you could
JeeJee
Profile Blog Joined July 2003
Canada5652 Posts
December 08 2009 04:46 GMT
#16
yeah good point.
(\o/)  If you want it, you find a way. Otherwise you find excuses. No exceptions.
 /_\   aka Shinbi (requesting a name change since 27/05/09 ☺)
onmach
Profile Blog Joined March 2009
United States1241 Posts
December 08 2009 04:57 GMT
#17
I had to tweak a few things to get it to work just right.

For url pattern, enable regexp and use this:
http://www.teamliquid.net/(forum|blogs)/view(message|blog)\.php.*


For link xpath:
//a[text() = 'Next' and contains(@title, 'Next Page') and contains(@href, 'view')]


For content xpath:
//td[@valign="top"]//table[@width=600]


Sure makes following the fitness thread easier.
SonuvBob
Profile Blog Joined October 2006
Aiur21549 Posts
December 08 2009 05:26 GMT
#18
On December 08 2009 13:41 Elemenope wrote:
Then why is charliemurphy able to post ze

He's only able to post about half the time :p
Administrator
JeeJee
Profile Blog Joined July 2003
Canada5652 Posts
December 08 2009 05:55 GMT
#19
random followup question (probably @onmach )
currently my next page loads at the top of my current one rather than the bottom -- any way to change this? (i.e. not make it load the next page until i've reached the bottom of the current one)
i've tried experimenting with "paging when space is less than X window heights" but that option doesn't seem to do anything at all >.>
(\o/)  If you want it, you find a way. Otherwise you find excuses. No exceptions.
 /_\   aka Shinbi (requesting a name change since 27/05/09 ☺)
ForTheSwarm
Profile Blog Joined April 2009
United States556 Posts
December 08 2009 06:33 GMT
#20
On December 08 2009 14:26 SonuvBob wrote:
Show nested quote +
On December 08 2009 13:41 Elemenope wrote:
Then why is charliemurphy able to post ze

He's only able to post about half the time :p


Ha ha ha. So true too, lol.
Whenever I see a dropship, my asshole tingles, because it knows whats coming... - TheAntZ
onmach
Profile Blog Joined March 2009
United States1241 Posts
Last Edited: 2009-12-08 16:37:03
December 08 2009 16:36 GMT
#21
I noticed the same thing. Annoying.

The reason (I think) is because it loads the page when it sees the first next link on the page. The first link it sees is at the very top of the thread, so it figures you are at the bottom of the page. Since both the top and bottom next links are identical, I'm having trouble telling xpath to get the second one with the // search type.

edit: Here's a fix:

(//a[text() = 'Next' and contains(@title, 'Next Page') and contains(@href, 'view')])[2]


This selects the second next link only. The other thing I had to do was in site manager in the advanced tab for your rule, select 0 for the minimum preloaded page count. I think it defaults to one preloaded page, which causes an auto load.
JeeJee
Profile Blog Joined July 2003
Canada5652 Posts
December 08 2009 19:22 GMT
#22
On December 09 2009 01:36 onmach wrote:
I noticed the same thing. Annoying.

The reason (I think) is because it loads the page when it sees the first next link on the page. The first link it sees is at the very top of the thread, so it figures you are at the bottom of the page. Since both the top and bottom next links are identical, I'm having trouble telling xpath to get the second one with the // search type.

edit: Here's a fix:

(//a[text() = 'Next' and contains(@title, 'Next Page') and contains(@href, 'view')])[2]


This selects the second next link only. The other thing I had to do was in site manager in the advanced tab for your rule, select 0 for the minimum preloaded page count. I think it defaults to one preloaded page, which causes an auto load.


man
you rule
:D
tyvm..browsing TL got more addictive with a lot less clicking... (is that a good thing? :s)
(\o/)  If you want it, you find a way. Otherwise you find excuses. No exceptions.
 /_\   aka Shinbi (requesting a name change since 27/05/09 ☺)
Normal
Please log in or register to reply.
Live Events Refresh
OSC
13:00
King of the Hill #216
davetesta84
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 353
Hui .249
Vindicta 53
StarCraft: Brood War
Britney 55779
Calm 4685
Rain 3107
Shuttle 3057
EffOrt 1592
Horang2 1251
Hyuk 1093
Larva 720
BeSt 341
hero 182
[ Show more ]
Mini 162
Nal_rA 155
Light 142
Mind 127
ToSsGirL 108
Rush 76
Snow 68
Mong 61
Barracks 57
Hyun 48
Shinee 48
Movie 36
soO 33
JYJ26
HiyA 16
Shine 13
yabsab 10
SilentControl 10
IntoTheRainbow 9
Backho 7
zelot 4
Dota 2
Gorgc9712
qojqva3542
League of Legends
singsing2639
Trikslyr29
Counter-Strike
zeus364
Foxcn254
byalli99
edward55
Other Games
Grubby2701
B2W.Neo1683
hiko1078
Lowko406
FrodaN356
Fuzer 327
Pyrionflax54
QueenE36
LuMiX1
Organizations
StarCraft 2
WardiTV19
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• iHatsuTV 4
• sooper7s
• Migwel
• AfreecaTV YouTube
• LaughNgamezSOOP
• intothetv
• IndyKCrew
• Kozan
StarCraft: Brood War
• Michael_bg 9
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 2938
• WagamamaTV528
League of Legends
• Nemesis6970
• Jankos1606
• TFBlade878
Other Games
• Shiphtur28
Upcoming Events
WardiTV European League
13m
Scarlett vs Percival
Jumy vs ArT
YoungYakov vs Shameless
uThermal vs Fjant
Nicoract vs goblin
Harstem vs Gerald
FEL
13m
Big Brain Bouts
13m
RotterdaM353
Korean StarCraft League
11h 13m
CranKy Ducklings
18h 13m
RSL Revival
18h 13m
ByuN vs Cham
herO vs Reynor
FEL
1d
RSL Revival
1d 18h
Clem vs Classic
SHIN vs Cure
FEL
1d 20h
BSL: ProLeague
2 days
Dewalt vs Bonyth
[ Show More ]
Replay Cast
3 days
Sparkling Tuna Cup
3 days
The PondCast
4 days
Replay Cast
5 days
RSL Revival
5 days
Replay Cast
6 days
RSL Revival
6 days
Liquipedia Results

Completed

Proleague 2025-06-28
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.