Skip to content

Instantly share code, notes, and snippets.

@wiz64
Created December 8, 2022 16:40
Show Gist options
  • Save wiz64/c15de0ba95bfdd8570343e98868b0e52 to your computer and use it in GitHub Desktop.
Save wiz64/c15de0ba95bfdd8570343e98868b0e52 to your computer and use it in GitHub Desktop.
autobingrandomsearch.py
# Automatic Random bing search script : @wiz64
# Use Keypress simulations to perform automated bing searches
# modify sleep time as per you needs and internet speed
# goto bing, do a search, count the number of time you pressed "tab" button and then run
# `python autobingrandomsearch.py <number_of_searches_to_make> <tab_btn_count>`
# in case any error,or not working as expected, to stop, goto shell/cmd window ASAP and bash ctrl + c
import argparse
from time import sleep
import string
import random
import pyautogui
parser = argparse.ArgumentParser()
parser.add_argument('x', type=int)
parser.add_argument('y', type=int)
args = parser.parse_args()
x = str(args.x)
y = str(args.y)
if(args.y):
n_tab = args.y
else:
n_tab = args.y
def id_generator(size=16, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
print("makeing "+x+" searches")
i = 0
print("Starting in 3s")
sleep(3)
while (i < args.x):
i = i + 1
print("Hits = "+str(i))
to_search = id_generator()
pyautogui.write(to_search)
print("Searching -> " + to_search)
pyautogui.press('enter')
# sleep for 5 seconds
sleep(2)
# tab tab tab
pyautogui.press('tab', presses=n_tab)
sleep(1)
#ctrl + a
pyautogui.keyDown('ctrl')
pyautogui.press('a')
pyautogui.keyUp('ctrl')
print("Done "+x+"Hits")
exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment