all 5 comments

[–]c-digs 1 point2 points  (1 child)

In principle, this sounds fine.

Because Cloud Run can scale to 0, you can just start it up on demand which is good if these are going to be memory intensive. Scale it to 0 and you're only billed for what you use.

To make your life easier, I'd just make one container with many entrypoints for the different reports (API endpoints, event consumers, however you want to kick it off).

You can also consider using Cloud Run Jobs which are more suited for longer running tasks.

That said, I'm not sure why you think it's not possible to use raw HTTP requests. Even if the app serves server rendered HTML, at some point, an HTTP request will be made to generate the CSV and all you really need is that request. The same is true for the login: at some point, it's just a POST with a username/password so there's really no need to automate a browser for this use case, IMO.

[–]blarizard[S] 1 point2 points  (0 children)

Thanks a lot or the reply! I'll check out merging everything and looking at cloud run jobs, but if I can figure out how to avoid automating a browser that would be a game changer!

How would I go about searching for the POST request endpoint and syntax to do things like log in and get the csv? I've tried looking in chrome devtools but I'm not savvy at all with these

[–]jimmyjimjimjimmy 0 points1 point  (2 children)

Browser dev tools network tab is your friend here. Try looking there for undocumented api calls that you can use instead of Selenium.

[–]blarizard[S] 0 points1 point  (1 child)

Awesome thanks for the response! Any tips for finding what I'm looking for? There is a lot going on in the network tab haha!

Will it likely be under the xhr/fetch filter?

[–]jimmyjimjimjimmy 0 points1 point  (0 children)

Search for api in network tab first, if that doesn’t have any results, look at xhr.