Crissal1995 / automsr

MIT License
7 stars 0 forks source link

Improve search generation to avoid bot detection checks #58

Closed Crissal1995 closed 1 year ago

Crissal1995 commented 1 year ago

Rationale: right now the search generation maybe is too weak; it is a meaningless string of 70 characters.

https://github.com/Crissal1995/automsr/blob/2fbad5a45227e801355e4aea6b3aafe45011b1e6/automsr/search.py#L47-L51

Another issue could be sending the entire string with one send_keys, like with a copy-paste behavior.

https://github.com/Crissal1995/automsr/blob/2fbad5a45227e801355e4aea6b3aafe45011b1e6/automsr/executor.py#L382-L396

At the moment, we "paste" the generated string in the search bar, and then we only return a backspace from the search generator to delete the last character from the search box, "generating" a new word, thus counting as a new search.

https://github.com/Crissal1995/automsr/blob/2fbad5a45227e801355e4aea6b3aafe45011b1e6/automsr/search.py#L60

The idea is that we could improve on this with the following possibilities:

  1. Keep the current behavior, but send the first string one character at the time, maybe with a little sleep in between, e.g., the one it would take an human to smash keys on the keyboard to produce a random string, and maybe change the length, from 70 to a random value (bigger than a certain threshold, to ensure every required search is performed).
  2. Generate a random sentence every time (see module faker), and send keys one by one, not the entire string at once.
  3. Use a search generator of valid searches, e.g., Google searches, maybe parsing an user-provided json/text file.