-
Notifications
You must be signed in to change notification settings - Fork 19
Actions
Actions allow you to find the next page in a series of pages.
These are the four available Actions:
- Next Link
- Click Element
- Increment URL
- URL List
Infy Scroll Note
Actions are only compatible with certain append modes. See the compatibility chart for more details.
Selecting the right action is dependant on the specific website you're on because each site is designed differently.
For example, many websites feature a link to the next page, so you'll probably want to first try using the Next Link
action. More modern AJAX sites that don't have links will require you to use the Click Element
action. If the URL has an incrementable sequence like a page=1
in it, you can use the Increment URL
action. Finally, if you already have a list of URLs to navigate to, you can use the URL List
action.
These four actions will cover practically every possible use-case you might run into.
Actions like Next Link and Click Element rely on a path to the link or element. There are two tools available to you for generating the path:
Many pages have a link that take you to the next page.
The app will automatically try to find the next link using its algorithm, so you may not need to configure anything. The algorithm first attempts to use the Next Link Path
(Selector or XPath). The default Selector path [rel='next']
works on many websites. If it can't find a link using the path, it then tries using the Next Link Keywords
(found in the Options Page) to parse the entire page for a link that has one of those keywords. You can edit the path in the UI Window and the app will re-try to find the next link automatically, giving you total control.
Important Note About Next Links
You should also make sure there actually is a link on the page. Some websites are actually AJAX sites or Single-page Applications that use AJAX techniques, not links. You'll need to inspect the page using DevTools to verify there's a link. For example, you may be on a Complex Website, which requires the Click Element action instead.
Need to follow the Previous Link instead? You can change the Link Type
from Next to Prev and the app will start using the Prev Link Path and Keywords.
If you generated the path using DevTools or the Element Picker and it uses nth-child
(Selector) or [Number]
(XPath), this path may fail to find the link on the next page in the HTML Markup. For example, imagine a paginated list of numbered links like Page 1, Page 2, Page 3, ...
. Now, say you're on Page 1 and the generated Selector found Page 2
to be the 2nd element in the list and therefore used nth-child(2)
. While this will work to find Page 2, it won't work to find Page 3 (and future pages) because Page 3 is the 3rd element, or nth-child(3)
, and your path, which was using nth-child(2)
, won't work anymore. In this case, you will need to write a custom path that takes into account sibling
and/or parent
relationships.
The algorithm is designed to try to find the next or prev link first via the Selector or XPath expression, and then fall back to parsing the page using the Keywords. However, this "test" on whether to use the keywords is only done the first time it tries to find the link.
For example, say it found the next link using the path initially (on page 1), and then fails to find the next link using the path on page 2. The app won't fall back on the keywords in that situation and will give up. In other words, it will only try using Keywords if it failed to find the next page the very first time on page 1 (but it will continue to keep using the keywords on subsequent pages since it knows it failed to do it using the path on page 1).
After spending several hours testing several websites, I found this strategy to hit that "just right" Goldilocks approach and keep it from being too aggressive.
Overriding The Algorithm
That said, you can always override this and have it always fall back on Keywords no matter what. You can do this by manually going into the UI Window, entering Setup, and checking the Look for links using keywords if the path fails
checkbox.
If the website you're dealing with doesn't have a next link or incrementable URL, this will be your next-best option. There's two use-cases for using this Action:
- Some websites have an annoying
Load More Button
, and the app can click that button for you. - The website is an AJAX site and you will need it to click a
Next
button.
You'll need to provide the path for the click element the same way you did for finding the next link.
If the URL has a number or something that can be incremented like a page=1
, you can try using this action. Incrementing a URL is fairly straightforward: simply select the part of the URL you want incremented (e.g. the 1
in the above example), and the app will increment it based on the settings you set. The Base Type
should be Default
(or Base 10
) for most numbers, however the app can increment all sorts of things, from Dates to Roman Numerals and even Custom Alphabets you define.
Need to decrement instead? Just negate the Interval
and use a negative number like -1.
If you already have a list of URLs, simply paste them in the input and the app will use them to determine the next URL in the sequence. Just make sure the following requirements are met:
- The URLs must be full URLs and start with a protocol, like
https://
. This is so the app doesn't get confused and treat your URLs like they're relative URLs. For example, a full URL should look something like:https://www.google.com/page1
, notwww.google.com/page1
orgoogle.com/page1
. - The URLs must be separated by line breaks.
- Infy Scroll Only: The page you are currently on matches the same domain of all the pages in your list. Infy can only append URLs that belong to one domain, and you need to be already on that domain. In other words, your list can't feature URLs from two different domains like
google.com
andmicrosoft.com
; it's only one or the other.
If you turn on AUTO, you can put any value in the Times
input. The app will automatically use the length of your URL List as the Times
so there is no need to manually enter this value.
To help you create a list of URLs on-demand, there are two buttons available:
- Find Links
- Sort List
You can click the Find Links Button to populate the list with all the links on the page and then manually remove the ones you don't want. By default, the links will be sorted in the order the web page lists them. However, you can also click the A-Z button to sort the links alphabetically if it helps group the ones you want together.