WithStorageType begins a storage definition and sets its type (cookie, localStorage, sessionStorage, indexedDb, cache). WithStorageKey sets the key for the storage item. WithStorageData sets the value to write for set operations.
WithStoragePath and WithStorageDomain restrict cookie scope. WithStorageStoreName sets the IndexedDB store name. WithDeleteAcrossOrigins controls whether delete operations cross origin boundaries. WithUserDefined stores a filter value a workflow can pick definitions out by.
A definition carries no action of its own. It says what storage is meant, and the workflow says what to do with it: RunGet, RunSet or RunDelete. Nothing runs on its own when the browser navigates.
Multiple definitions can be chained on a single GPALUrl. GetActions hands back the definitions registered on this URL, in the order they were added.
Where they run: going to the url with GoTo or Get makes its definitions the ones RunGet, RunSet and RunDelete use. To run them on a site before going there, put For(url) in front of the Run call. The browser stays on the page it is on, the action uses that url's definitions, and it lasts for that one action.
A site's own cookies arrive with the very first request to it, so clearing them after GoTo still lets the site see one visit carrying them. Anti-bot vendors keep their verdict on a browser in such a cookie (Akamai's _abck, DataDome's datadome, Cloudflare's cf_clearance), so one flagged visit on a profile follows every visit after it. For(url) clears them before the visit, so the site only ever sees a clean one.
WebDriver lists only the storage of the site the browser is on, and Firefox has no CDP to reach further, so For cannot reach another site from Selenium on Firefox. The action says so with a WARNING and finds nothing. Go to the site, run the action there, and reload. OttoMagic, Puppeteer, and Selenium on Chrome and Edge all reach any site.
//The definitions say what storage is meant and the Run call says what to do with it. GoTo makes a url's definitions the ones a Run call uses; For uses another url's definitions for the next Run call without going there, which is how a workflow clears a site's cookies before visiting it. The browser has to be running, so For comes after the first GoTo or Get.
// declare what is meant: every cookie on gucci
GPALUrl gucci = "https://www
gucci
// clear Akamai's verdict cookie before going there, then go
browser
// read a cookie on the page the browser is on: going there made its definitions current
GPALUrl checkUrl = "https://example
checkUrl
browser
// set a localStorage value on the page
GPALUrl themedUrl = "https://app
themedUrl
browser
// with nothing scoped, a Run call runs every definition of that type on the url
browser
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();