• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 04:19
CEST 10:19
KST 17:19
  • 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
[ASL20] Ro24 Preview Pt2: Take-Off5[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature4Team Liquid Map Contest #21 - Presented by Monster Energy9uThermal's 2v2 Tour: $15,000 Main Event18
Community News
Weekly Cups (Aug 18-24): herO dethrones MaxPax0Maestros of The Game—$20k event w/ live finals in Paris29Weekly Cups (Aug 11-17): MaxPax triples again!13Weekly Cups (Aug 4-10): MaxPax wins a triple6SC2's Safe House 2 - October 18 & 195
StarCraft 2
General
Weekly Cups (Aug 18-24): herO dethrones MaxPax What mix of new and old maps do you want in the next 1v1 ladder pool? (SC2) : 2v2 & SC: Evo Complete: Weekend Double Feature Geoff 'iNcontroL' Robinson has passed away The GOAT ranking of GOAT rankings
Tourneys
Maestros of The Game—$20k event w/ live finals in Paris RSL: Revival, a new crowdfunded tournament series Sparkling Tuna Cup - Weekly Open Tournament Monday Nights Weeklies Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
External Content
Mutation # 488 What Goes Around Mutation # 487 Think Fast Mutation # 486 Watch the Skies Mutation # 485 Death from Below
Brood War
General
[ASL20] Ro24 Preview Pt2: Take-Off No Rain in ASL20? BW General Discussion Flash On His 2010 "God" Form, Mind Games, vs JD BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[ASL20] Ro24 Group D [ASL20] Ro24 Group B [ASL20] Ro24 Group C BWCL Season 63 Announcement
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates [G] Mineral Boosting Muta micro map competition
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread General RTS Discussion Thread Dawn of War IV Path of Exile
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
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine The year 2050 European Politico-economics QA Mega-thread
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
High temperatures on bridge(s) Gtx660 graphics card replacement Installation of Windows 10 suck at "just a moment"
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
Evil Gacha Games and the…
ffswowsucks
Breaking the Meta: Non-Stand…
TrAiDoS
INDEPENDIENTE LA CTM
XenOsky
[Girl blog} My fema…
artosisisthebest
Sharpening the Filtration…
frozenclaw
ASL S20 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 3945 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
Next event in 1h 42m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nina 192
StarCraft: Brood War
Sea 4317
ggaemo 531
Leta 317
Zeus 263
Bisu 238
actioN 179
Soma 166
Hyuk 104
ToSsGirL 84
TY 77
[ Show more ]
Shine 63
Sharp 41
Hm[arnc] 11
Dota 2
XcaliburYe117
League of Legends
JimRising 617
Counter-Strike
Stewie2K976
Super Smash Bros
Westballz49
Other Games
summit1g8852
singsing1326
C9.Mang0347
Fuzer 209
Happy191
SortOf93
Organizations
Other Games
gamesdonequick748
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH397
• LUISG 23
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1441
• HappyZerGling186
Upcoming Events
Afreeca Starleague
1h 42m
Queen vs HyuN
EffOrt vs Calm
Wardi Open
2h 42m
RotterdaM Event
6h 42m
Replay Cast
15h 42m
Afreeca Starleague
1d 1h
Rush vs TBD
Jaedong vs Mong
WardiTV Summer Champion…
1d 2h
Cure vs Classic
ByuN vs TBD
herO vs TBD
TBD vs NightMare
TBD vs MaxPax
OSC
1d 3h
PiGosaur Monday
1d 15h
Afreeca Starleague
2 days
herO vs TBD
Royal vs Barracks
Replay Cast
2 days
[ Show More ]
The PondCast
3 days
WardiTV Summer Champion…
3 days
Replay Cast
3 days
LiuLi Cup
4 days
MaxPax vs TriGGeR
ByuN vs herO
Cure vs Rogue
Classic vs HeRoMaRinE
Cosmonarchy
4 days
OyAji vs Sziky
Sziky vs WolFix
WolFix vs OyAji
BSL Team Wars
4 days
Team Hawk vs Team Dewalt
BSL Team Wars
4 days
Team Hawk vs Team Bonyth
SC Evo League
5 days
TaeJa vs Cure
Rogue vs threepoint
ByuN vs Creator
MaNa vs Classic
[BSL 2025] Weekly
5 days
SC Evo League
6 days
BSL Team Wars
6 days
Team Bonyth vs Team Sziky
BSL Team Wars
6 days
Team Dewalt vs Team Sziky
Liquipedia Results

Completed

CSLAN 3
uThermal 2v2 Main Event
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL Season 18: Qualifier 1
Acropolis #4 - TS1
SEL Season 2 Championship
WardiTV Summer 2025
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

CSL Season 18: Qualifier 2
CSL 2025 AUTUMN (S18)
LASL Season 20
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
RSL Revival: Season 2
Maestros of the Game
EC S1
Sisters' Call Cup
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
MESA Nomadic Masters Fall
CS Asia Championships 2025
Roobet Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
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.