In a world where PDF documents reign supreme for sharing and preserving content, the need to download them efficiently is a common task. Whether it's research papers, user manuals, or reports, we all find ourselves needing to gather PDFs from the vast expanse of the internet. However, manually downloading each PDF file can quickly become a tedious and time-consuming process.
One such remarkable feature in our RPA tool is the browser package—a comprehensive suite comprising 23 meticulously designed nodes. From opening browsers to capturing screenshots, these nodes offer a versatile set of capabilities that can revolutionize the way we interact with web content.
In this blog post, we will explain how to automate the process of downloading PDFs using Browser Automation with Robomotion.
How to Setup?
About Browser Package
The browser package refers to a collection of nodes that are specifically designed to interact with web browsers. These nodes enable automation of web-based tasks and processes by providing a set of actions that mimic human interactions with a browser.
The browser package consists of 23 nodes, each representing a specific action that can be performed within a web browser. These actions range from basic functions like opening and closing browsers, clicking on elements, and navigating forward or backward, to more advanced operations like capturing screenshots, handling alerts, and even executing custom scripts within the browser environment.
- ‘Inject’ node is used to initialize the flow.
Function Node Named “Config” Code-Block:
//User Directory Path to save Chrome settings
msg.user_directory_path = "YourUserDataDirFolderPath";
//Download Path to save PDF files
msg.download_path = "YourDownloadFolderPath";
//Give a url for the pdf file to download
msg.url = "https://www.fedex.com/content/dam/fedex/us-united-states/services/Fees_Shipping_Information.pdf";
- During the initial run, you should establish a connection to the "Save Settings" sub-flow node, which comprises four individual nodes:
- The "Create User Data Dir" node within the "File Create" category is used to generate the "User Data Dir" folder at the specified path.
- The node called "Create Download Dir" under the "File Create" category is used to establish the "Download Folder" at the provided path.
- The node labeled "Open Browser First Run" is used to select the browser type and initiate the browser driver on the machine.
- The 'Open Link First Run' node is used to navigate, directing you to the specified URL.
- Once the page loads, follow these steps to save your settings:
- Open Chrome Settings.
- On the currently displayed page, navigate to "Privacy and Security".
- Choose "Site Settings".
- Choose the "Additional Content Settings".
- Choose the PDF documents.
- Select "Download PDFs".
- You can now stop the flow and disconnect the "Save Settings" sub-flow.
Once the main flow has stopped and disconnected from the "Save Settings" sub-flow, you can proceed by establishing a connection to the "Open Browser" node. Subsequently, you can initiate the flow once more.
The "Open Link" node is utilized to access the provided PDF download URL. This action will trigger the opening of the webpage and initiate the immediate download of the PDF documents. The downloaded document will be saved to the designated "Download Folder" path, which is specified within the "Config" function node.
The “Stop” node is used to stop the flow.
Here you can access the complete flow by clicking on the following link: https://casestudies.robomotion.io/designer/shared/RxwBFxvjVC3A4jqjF9LYZf