What I want to do is open each thread on the message board and, if there is a file download link in the post, click it to download the file.
I can open each thread in turn, but I’m having trouble implementing the process for clicking links in the post.
The link text is displayed as text, with the download URL embedded as a hyperlink. Clicking the link directly downloads the file.
I was able to retrieve a URL on one page using the “Extract Table Data” activity, but it doesn’t retrieve the URL on other thread pages, so I haven’t been able to proceed.
How can I accomplish this?
Here’s an image for reference.
Each topic is on a separate page, and each post contains a mix of download links and other links.
I only want to retrieve the download links.
The reason Extract Table Data worked on one page and failed on others is usually because the underlying HTML structure (such as the number of paragraphs or extra links like 関連資料を表示する) changes from thread to thread, which breaks the generated selector.
Since your download links consistently use the link text ダウンロードする, you don’t actually need Extract Table Data at all. A couple of much more reliable ways to handle this:
Check App State + Click (if there is one download link per post): Add a Check App State activity inside your browser scope and indicate the ダウンロードする link. Open the selector in UI Explorer and make sure it only relies on tag=‘A’ and aaname=‘ダウンロードする’ (or aaname=‘ダウンロード’ with a wildcard), removing any page-specific attributes like title, url, or idx. In the Target appears branch, just use a Click activity with that same selector to trigger the download directly.
For Each UI Element + Get Attribute (if a post can have multiple download links or you need the URLs): Use the For Each UI Element activity and indicate one of the ダウンロードする links. It will automatically find all matching download links on that thread page while ignoring other links like 関連資料を表示する. Inside the loop, you can either Click CurrentElement directly or use Get Attribute (“href”) as @YankitSingh mentioned to pull the exact download URL.
If the link text itself varies across pages, you can also use Find Children on the post body container with the filter “”, loop through the elements, and check Get Attribute (“href”) for file extensions like .pdf, .zip, or .xlsx before clicking.
From your screenshot, all the download links have the same text, and the other link is different. So you can use the text to click only the download links.
If each page has only one download link:
Use a Click activity and indicate the required link. Then open Selector Editor and keep only the stable parts, something like this:
If a page can have more than one download link:
Use Find Children, indicate the area that contains the post (not the link), set the scope to FIND_DESCENDANTS and the filter to .
Use For Each UI Element to loop through the links.
Inside the loop, use Get Attribute with innertext and store it in a variable, for example linkText.
Add an If with the condition linkText.Trim = " ".
If it is true, use Click on the current item.
Please print linkText once with Log Message to confirm the exact value. Also check in Selector Editor that innertext is available for your link, because it can change from site to site.
If the page reloads after a click and the loop stops working, first store all the matching href values in a list, and then open them one by one.
I believe you are able to click the Download button, and the file gets downloaded. You just want to save it to the desired folder path.
You can either enable the “Ask where to save each file” option in your browser and automate the Save As popup, or use the Wait for Download activity and then move the downloaded file to your desired location.
If there is an issue clicking the Download button, try using the Hover activity before the Click activity. Also, make sure your selector does not contain the hyperlink value.
This depends on the page structure, so if possible, please share more specific information (such as the page structure or how UiExplorer recognizes the target element).
If the site is publicly accessible, it may be helpful to share the URL.
I’m not having any trouble with the download process itself.
I don’t know what text the links on the page might contain.
The visible text is meaningless. I want to decide whether to click a hyperlink based on whether it’s a specific one.
In short, what I want to do is: “Detect all hyperlinks on a page and decide whether to click each one based on whether it has a particular structure.”
The overall process would look like this:
① Open the page
② Look for links
③ If there are any links, repeat:
④ Click each link if it has specific content
③ End repeat
① End repeat
I’d like to implement this process. Thank you for your help.
The site is an internal bulletin board, so I can’t make it public.
I’m not sure how to provide „more specific information (such as the page structure or how the target element is recognized in UiExplorer).”
Which screen should I use to check this?