some days ago a colleague showed me an addon for Firefox which became one of my favourites within seconds. Autopager automatically loads the next page if you scroll down the current page. Autopages dynamically adds the content of following pages at the and of the content area of currently viewed page. So you will never be bothered again to skip through pages on forums, search results, online shops and so on
On the screenshot above you an example see how AutoPager works on google. Nice, isn’t it?
AutoPager works with a huge amount of sites out of the box (e.g. google, amazon, phpBB based forums). However sometimes you will come to a page were AutoPager has no valid rule. For example if you visit the support forum of my provider http://forum.sysprovide.de AutoPager will not automatically load all threads of a board, since there is no valid rule for WoltLab Boards. Creating your own one is very easy and it is just a matter of one or two minutes.
- Right-click on the small icon in your status bar of Firefox
- Select “Site Wizard” in the popup menu
- The Wizard tries to identify the three mandatory attributes which are needed in a AutoPager-Rule
The first textbox “Address Rule” defines which pages will match the rule. You can use wildcards like * in the URL to make it more generic. In the example above you can replace the domain “sysprovide” with an asterisk or you can even use the expression “*board.php?*” so that the rule will be used on every WoltLab Messageboard.
The second box shows the XPath of the “Next”-Link and the third box defines the XPath of the content area, i.e. the part of following pages which will be inserted into the current page.
- After we set the “Address Rule” we now have to click on the “Link Selector”-Icon.
- Find the “Nächste” (i.e. “Next”)-Link on the page and click on it.
- The wizard will make several suggestions for XPath-Expressions identifiying the “Next”-Button. Make a double click on the expression “//a[contains(text(),'nächste »')]“.
- In the Result-View at the bottom of the wizard a list of results will be listed, matching the XPath you have selected. If you have done everything right the wizard will show one match “nächste >>” (s. screenshot).
- Now you have to define the content area. Click on the Content Selector.
- Move the mouse cursor to the list of threads and a rectangle will appear.
- Type “w” so often that the rectangle will fit the whole list of threads and left click on it.
- Select “//table[tbody/tr/@class=’smallfont’]” in the list of suggested XPath.
- Left click the green check mark to add your rule to AutoPager.
When you visit the page next time (or when you reload the page) AutoPager will use your rule and will automatically load the whole list of threads.
If you want to get more detailed information about the creating rules with AutoPager you should visit the Developer Homepage…and if you want to become a XPath-geek you should also read this XPath-Tutorial.