😎 Planet MineCraft Username Scrapper Source | Python 3

Posts 1–2 of 2 Β· Page 1 of 1
😎 Planet MineCraft Username Scrapper Source | Python 3
Hey guy's so i made this username scrapper using python and it was laying around in the folders having no use for me so i decided to release it

1:Make sure you are using Python 3

2:Make sure you got the Beautiful Soup 4 Plugin/Module

3:Make sure you got the Requests Plugin/Module

4:Your ALL SET!


Get the source and use it pic of it in action

Can be way faster with scraping if its multi threaded i made this when i was learning python scraping so ye x.x



Source:
http://pastebin.com/N5yPATKKⓘ
If you use python 3.1+
@ToxLP This is a VERY nice application/source for minecraft scraping. I speak for all of my mac brethren when I say thank you for giving us something we can use

==EDIT==
import threading

__author__ = 'ToxLP'

import requests
from bs4 import BeautifulSoup

count = input("How many pages:")

max_pages = count

cmd = raw_input('CMD : ')

cmd = str(cmd)

def blah(max_pages):
pages = 1

while pages <= int(max_pages):

header = {"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"User-Agent": "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.122 Safari/537.36 OPR/24.0.1558.64",
"Host": "www.planetminecraft.com"}

url = 'http://www.planetminecraft.com/resources/blogs/?p=' + str(pages) + '&sort=order_latest'
source = requests.get(url, headers=header)
text = source.text
soup = BeautifulSoup(text)

for element in soup.findAll('a', {'class': 'r-title'}):
links = "http://www.planetminecraft.com" + element.get('href')
get_users(links)
pages += 1


def get_users(sec_url):
header = {"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"User-Agent": "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.122 Safari/537.36 OPR/24.0.1558.64",
"Host": "www.planetminecraft.com"}

source = requests.get(sec_url, headers=header)
text = source.text
soup = BeautifulSoup(text)

for users in soup.findAll('div', {'class': 'mini-info'}):
for usernames in users.findAll('a', {'class': 'alt pusername '}):
print(usernames.string)

if cmd == "mcscrap":
t = threading.Thread(blah(max_pages))
t.daemon = True
t.start()
else:
print("Invalid Command. Try again...")
Posts 1–2 of 2 Β· Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us