from googlesearch import search

# to search
query = "competition level physics past exams filetype:pdf"

max_ct = 1_000
step = 25

for idx in range(0, max_ct, step):
    lst = list(enumerate(search(query, num=step, stop=idx + step, start=idx, pause=2)))
    print("hi")
    for i, j in lst:
        print(f"{i + idx}: {j}")
