#!/usr/bin/env python3 import random import string import requests as rq BASE="cE4g5bWZtYCuovEgYSO1" def request_page(page): url = "http://167.71.246.232:8080/rabbit_hole.php?page=" resp = rq.get(url+page) return resp def parse_resp(resp): (num,new_page) =resp.split("\n"); (index,value) = num[1:-1].split(",") return index,value,new_page[1:] if __name__ == "__main__": TAB = [""] * 2000 #A big Array to have enough space page = BASE f = open("Log_pages.log", "w") while(1): resp = request_page(page) if len(resp.text) < 1: break # Finish when there is no new cell in web page (index,value,new) = parse_resp(resp.text) TAB[int(index)] = value[2:-1] #Fill the tab print("retrieve:" + "".join(TAB),end="\r") page = new f.write("[%s,%s]\n%s\n\n" % (index,value, page)) #Write logs print("\n\nFinal TAB: " + "".join(TAB))