I am writing a blog post about why it is bad to use AI. It is extremely heavily sourced. I have a tedious automation problem formatting my citations. No problem, I think. I will write a computer program. The computer program does not work, because websites are blocking simple computer programs in an effort to block AI. Solution? Simple. Browser comes with AI embedded, browses like a human, has all my cookies. Just ask the AI. It sails through the primitive anti-AI measures easily.
(I did not actually do this. But it is an advertised feature of chrome, and I am pretty sure it would "work", as much as any AI-based solution "works".)
serious question though, is there a requests (or httpx or treq or whatever) compatible selenium driver so that I can write a simple Python CLI that just says "give me URL please" and Safari does all the HTTP traffic so it can get the request body with all my ridiculous CAPTCHAs and news website logins in it
we live in hell but at least PyPI works in hell
@glyph lol yeah, you get how fragile and awful this type of thing is
@glyph heh, my side project this week was the reverse of that - selenium to "run" a page (lots of javascript based partial execution) and click a button (which rewrote part of the page without reloading)... and then extract a URL from that and use requests to cleanly get a Location: header out (basically forcing the service to canonicalize itself for me.)
@glyph ytdlp has some underlying features like this, might be a thing you could import but probably not a public api :)
@coderanger @glyph yeah! There's a feature where you point it at your browser's state directory (which for Firefox you can find in about:profiles) and it can borrow all of your cookies. I've definitely wanted to figure out how to quickly implement this in scripts in the past... But then my attention span jumps out a window...

@nicr9 +1 to Nic’s line of thinking.

Also to Nic’s attention span, this is an uninteresting (to me), very fiddly, very fragile way of accomplishing things.

It’s probably one of your best bets though.

@coderanger @glyph

@glyph we needed to do this for ironic, originally implemented it as selenium but switched to a Firefox extension
ironic

A service for managing and provisioning Bare Metal servers.

OpenDev: Free Software Needs Free Tools
@jay I need safari specifically and it looks like selenium works well enough
@glyph Yeah, halfway through this thread I was going to suggest Selenium so looks like you got it.

@glyph instead of Selenium, you may want to check out Playwright. https://pypi.org/project/playwright/

It allows browser automation in a very pythonic way - also headless. It installs its own Chrome/Firefox/Safari and avoids any configuration you done to your browser installs.

playwright

A high-level API to automate web browsers

PyPI
@mborus @glyph this, Playwright has been really nice to use in my experience!
@glyph There was this.
GitHub - ultrafunkamsterdam/undetected-chromedriver: Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM) - ultrafunkamsterdam/undetected-chromedriver

GitHub
@glyph maybe not a complete solution, but some have already tried tools to bypass protections, for instance for automating torrent downloads etc. : https://github.com/FlareSolverr/FlareSolverr
GitHub - FlareSolverr/FlareSolverr: Proxy server to bypass Cloudflare protection

Proxy server to bypass Cloudflare protection. Contribute to FlareSolverr/FlareSolverr development by creating an account on GitHub.

GitHub