@
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.planetminecraf*****m"}
url = 'http://www.planetminecraf*****m/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.planetminecraf*****m" + 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.planetminecraf*****m"}
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...")