Network & File Transfers

Left Click And Download

Performs a left click on the matched element and captures the file that downloads as a result, saving it to the specified location.

NOTE

A browser sometimes asks where to save even with prompting turned off. GPAL waits briefly for that, and answers it with the same full pathname rather than letting the workflow stall on a window nobody expected, publishing a WARNING that it did. The dialog is titled Save As on Chrome and Edge, and Enter name of file to save to on Firefox, which is why a browser GPAL does not recognise cannot be answered.

Examples

GPAL Fluent: High-level fluent C# API

//The GPALFile is where the file is to end up, and how it gets there depends on whether a Save As dialog is coming. With prompting off, or headless, no dialog appears: GPAL sets the download location, clicks, and watches the directory for the file to land. With prompting on, the dialog is expected, and GPAL waits for it and types the full pathname into it before pressing Enter. So this is not the same as SetDownloadFilename, which only names a file in the browser's own download directory.

browser.WithSelector(linkSelector).LeftClickAndDownload(gpalFile);

MagicHelper: MagicHelper utility library

browser.MagicHelper.LeftClickAndDownload("link123", filenameAndPath);

Puppeteer Client: Puppeteer-style C# client

//The PuppeteerClient call that names the destination is DownloadTo. It was SaveTo until August 2026.

browser.PuppeteerClient.LeftClickAndDownload(linkSelector).DownloadTo(fileToSave).Execute();

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.LeftClickAndDownload(elems, savePath, modifiers, sessionId, responses);

REST Client: Direct REST/HTTP client

browser.OttoMagicClient.WithEndpoint(ApiEndpoint.LeftClickAndDownload).WithElementId(linkSelector).WithDownloadFile(savePath).Execute();

💬 Ask GPAL