WithFileName opens an archive in the middle of a path the way it opens a folder. export.zip*.csv is the csv files at the top of the zip, export.zipdata*.csv the ones in its data folder, and export.zip
eport.csv that one file. The matching files are taken out to the GPAL temp directory when WithFileName runs, and from then on they are ordinary files: the converter, a grid, an upload or CopyTo use them without knowing an archive was involved.
The archive is known by what it holds, not by its name, so an .xpi, a .jar, an .xlsx or a download saved with no extension opens the same way. zip, 7z, rar and tar open, and so does a tar inside a gz, bz2 or xz: .tar.gz, .tgz, .tar.bz2 and .tar.xz. A gz, bz2 or xz holding a single file is a folder with one file in it, named without the extension, so data.csv.gz* is data.csv.
A url works the same when a wildcard follows the archive: https://example.com/export.zip/*.csv is fetched, then opened. Without the wildcard the url is fetched as it stands, so a link like .../tool.zip/download is not mistaken for a path inside a zip.
SaveTo makes an archive, and the destination's extension says which kind. A name is one archive: reports.zip holds every file. A wildcard keeps each file's own name: *.gz makes a.csv.gz, b.csv.gz and so on, and *.zip a zip for each. A folder goes in whole, its subfolders kept and its contents at the top of the archive, which is what an .xpi or a .vsix needs. With no folder in the destination the archive goes beside the source, and for a file taken out of an archive, beside that archive. SaveTo hands back the same files, so .Delete() after it removes the originals.
SaveTo writes zip, gz, tar and tar.gz or .tgz. zipExtensions in GPAL.yaml lists the names written as a zip, zip, xpi, jar, vsix and nupkg to start with, and gzExtensions the names written as a gz: gz, gzip and svgz. Add a name to either list to have SaveTo write it. 7z and rar open but are not written; save those as .zip or .tar.gz. GPAL.yaml is rewritten only when it is missing or the GPAL version changes, so an existing one may not show the two lines yet. The defaults apply until it does; add the lines by hand to change them sooner.
A gz is one file compressed, not a folder of them. Several files saved to one named .gz become reports.csv.gz, reports_0001.csv.gz and on, numbered with the counter whatever WithNextFilePattern says, since a date pattern would give them all one name. A folder cannot go in a .gz at all; SaveTo publishes an error and saves nothing. Use .zip or .tar.gz for more than one file.
//The path through the zip is the whole of the reading side; there is no unzip step. The converter gets orders.csv as an ordinary file. The url opens the tar.gz because a wildcard follows it. Every .log at the top of the tar is in logs.Filenames. The cast is there because SaveTo and Delete are actions on the GPALFile itself, the same as CopyTo. SaveTo returns the same files, which is why Delete after it removes the csv files and not the zip. The extension path is a folder, so the whole tree goes in; *.gz with no folder writes each .gz beside the file it came from.
// one file out of a zip, straight into the converter
GPALFile orders = (GPALFile)GPAL
GPAL
// a tar
GPALFile logs = (GPALFile)GPAL
// every csv in one zip, then the originals removed
((GPALFile)GPAL
// an extension folder packed as an
((GPALFile)GPAL
// each file gzipped beside itself under its own name
((GPALFile)GPAL
Showing off some plain text in these paragraphs eligendi laboriosam illo nostrum corporis at libero vel voluptas? Expedita, facere dolores voluptatem ad ab rem assumenda soluta!
Lorem ipsum dolor sit amet consectetur adipisicing elit. Obcaecati, iste distinctio veritatis eligendi laboriosam illo nostrum corporis at libero vel voluptas? Expedita, facere dolores voluptatem ad ab rem assumenda soluta!
Lorem ipsum dolor sit amet consectetur adipisicing elit. Obcaecati, iste distinctio veritatis eligendi laboriosam illo nostrum corporis at libero vel voluptas? Expedita, facere dolores voluptatem ad ab rem assumenda soluta!
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo veniam mollitia excepturi animi eum illum non libero sapiente provident assumenda, delectus voluptatum nobis sed dolorem adipisci laudantium incidunt. Error, ratione?
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo veniam mollitia excepturi animi eum illum non libero sapiente provident assumenda, delectus voluptatum nobis sed dolorem adipisci laudantium incidunt. Error, ratione?
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo veniam mollitia excepturi animi eum illum non libero sapiente provident assumenda, delectus voluptatum nobis sed dolorem adipisci laudantium incidunt. Error, ratione?
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo veniam mollitia excepturi animi eum illum non libero sapiente provident assumenda, delectus voluptatum nobis sed dolorem adipisci laudantium incidunt. Error, ratione?
Here you can find different accents and emphasis sit amet consectetur adipisicing elit. Obcaecati, iste distinctio veritatis eligendi laboriosam illo nostrum corporis at libero vel voluptas? Expedita, facere dolores voluptatem ad ab rem assumenda soluta!
This is a link and how it could look like bestlinkinthebeautifulworld. Obcaecati, iste distinctio veritatis eligendi laboriosam illo nostrum corporis at libero vel voluptas? Expedita, facere dolores voluptatem ad ab rem assumenda soluta!
Here's just some classic bold text adipisicing elit. Obcaecati, iste distinctio veritatis eligendi laboriosam notBoldSecondbestlinkinthebeautifulworld illo nostrum corporis at libero vel voluptas? Expedita, facere dolores voluptatem ad ab rem assumenda soluta!
Obcaecati, iste distinctio veritatis eligendi laboriosam adipisicing elit illo nostrum corporis at adipisicing elit libero vel voluptas? Expedita, adipisicing facere dolores voluptatem ad ab rem assumenda soluta!
Other cuple of colors in case we want to emphasize several ways adipisicing elit. Obcaecati, iste distinctio veritatis eligendi laboriosam adipisicing elit illo nostrum corporis at voluptatem libero vel voluptas? Expedita, facere dolores voluptatem ad ab rem assumenda soluta!
Lorem ipsum dolor sit amet consectetur adipisicing elit. Obcaecati, iste distinctio veritatis eligendi laboriosam illo nostrum corporis at libero vel voluptas? Expedita, facere dolores voluptatem ad ab rem assumenda soluta! Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quod veniam, quam ad expedita laborum sed at voluptates culpa ipsam ut vel. Ullam temporibus a mollitia quod aliquam ratione exercitationem nesciunt.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Obcaecati, iste distinctio veritatis eligendi laboriosam illo nostrum corporis at libero vel voluptas? Expedita, facere dolores voluptatem ad ab rem assumenda soluta! Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quod veniam, quam ad expedita laborum sed at voluptates culpa ipsam ut vel. Ullam temporibus a mollitia quod aliquam ratione exercitationem nesciunt.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Obcaecati, iste distinctio veritatis eligendi laboriosam illo nostrum corporis at libero vel voluptas? Expedita, facere dolores voluptatem ad ab rem assumenda soluta!
Lorem ipsum dolor sit amet consectetur adipisicing elit. Repudiandae quas consequuntur illo numquam assumenda autem exercitationem distinctio perspiciatis in natus. Eius dicta similique ipsam ipsa minima, nemo quae enim tempore.
GPAL
.CallIfNotFound(GenericCallIfNotFound)
.WithPublishToConsole();
//System.Drawing.Rectangle windowSize = new System.Drawing.Rectangle(10, 10, 1500, 1024);
// NOTE: we have to set browser = before we execute any steps
// this is due to the 'GenericCallIfNotFound' which might throw an exception, and BankScraper will not have the browser set when it calls scraper.Close()
// until the complete fluent line gets executed (meaning every step, meaning browser is not set until everything else succeeds)
browser = GPAL.Browser
.WithBrowserType(Enums.BrowserType.Chrome)
.WithProfileDataDirectory(ChromeProfileLocation)
.WithUseAutomationEngine(AutomationEngine.Selenium)
.WithWindowSize(new System.Drawing.Rectangle(0,0,1920,1080))
.ToGPALObject();