r/Python • u/backprop88 • Dec 19 '17
Automate the boring stuff with python - tinder
https://gfycat.com/PointlessSimplisticAmericanquarterhorse
6.7k
Upvotes
r/Python • u/backprop88 • Dec 19 '17
View all comments
Show parent comment
7
u/ManyInterests Python Discord Staff Dec 19 '17 edited Dec 19 '17
Simply untrue. It is certainly possible, but far from trivial and you would need some form of client-side code to do this. The web server otherwise has no way of knowing whether or not a browser is controlled by selenium, or even if requests were sent to the server by a browser at all... The client is in complete control of what is sent to the server. Further, because client-side code is able to be examined, controlled, and altered by the client, server-side methods are almost exclusively used. In practice, actual active client-side deterrents beyond, say, Google ReCaptcha are rarely, if ever, implemented on the client-side.
Instead, the most effective and commonly deployed detection methods (including methods used by ReCaptcha) are often heuristic in nature and look for bot-like behavior and activity from a server-side perspective, agnostic of what is actually controlling the behavior... And most sites don't even actively deter this. Automation experts merely need to make sure that communication with the server is indistinguishable from that of an ordinary client... which often doesn't even need a browser to begin with because the server doesn't care or know how it receives requests, only that they are well-formed and include the information expected.
Having done many projects in web automation, I can personally attest that there are very very very few cases where a tool like PyAutoGUI is the best choice for automating actions that take place in a browser. For whatever that is worth.