pastebin scraper #!/usr/bin/env python # -*- coding: utf-8 -*- """Pastebin Scraper Author: -zYMTOM' """ import re import requests from bs4 import BeautifulSoup def in_array(array, compare0): exist = False for i in range(0, len(array)): pastebin scraper How to dowload it? pastebin scraper if compare0[0] in array[i][0]: exist = True break return exist links = [] r = requests.post("http://pastebin.com/archive") var = BeautifulSoup(r.text.encode('utf-8')).find("div", {"id": "content_left"}) regex = re.compile('(.*?)<\/a>') reg = regex.findall(str(var)) for captures in reg: pastebin scraper How to use it? pastebin scraper if in_array(links, captures[0]) == False: links.insert(len(links)+1, [captures[0], captures[1]]) print(captures[0]) for link in links: r = requests.post("http://pastebin.com/raw.php?i="+link[0]) if not '
This paste has been removed!
' in r.text: f = open('pastes/'+link[0]+'-'+link[1], 'w') f.write(r.text.encode('utf-8')) pastebin scraper