Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- # IMPORTANT THINGS:
- # Made for Python 2.7
- # REQUIRES BeatifulSoup4 (pip install beatifulsoup4)
- import requests
- import re
- import hashlib
- from HTMLParser import HTMLParser
- from bs4 import BeautifulSoup
- forumThread = "4243377-b-steam-spiele-s-bietet-mir" # Thread ID + name (ex: "4239749-cheap-steam-game-shop")
- #PASSMD5 = hashlib.md5(PASSWD.encode('UTF-8')).hexdigest()
- #c.post(url, data={'vb_login_username': USERNAME,'s': '','securitytoken': 'guest','do': 'login','vb_login_md5password': PASSMD5,'vb_login_md5password_utf': PASSMD5,}, headers={"Referer": "http://www.elitepvpers.com/forum/"})
- print("Hello world!")
- fullURL = "http://www.elitepvpers.com/forum/elite-gold-trading/" + forumThread + ".html" # Formats the URL
- print("Read URL as: " + fullURL + "\n")
- Username = ""
- Password = ""
- pwmd5 = hashlib.md5(Password.encode("UTF-8")).hexdigest()
- print("Password hashed as: " + hashlib.md5(Password).hexdigest())
- payload = {
- "vb_login_username":Username,
- "vb_login_password":Password,
- "cookieuser":"1",
- "submit":"Log in",
- "s":"",
- "securitytoken":"guest",
- "do":"login",
- "vb_login_md5password":pwmd5,
- "vb_login_md5password_utf":pwmd5
- }
- pdata = {'vb_login_username': Username,'s': '','securitytoken': 'guest','do': 'login','vb_login_md5password': pwmd5,'vb_login_md5password_utf': pwmd5,}
- headers = {
- "Referer":"http://www.elitepvpers.com/forum/"
- }
- with requests.Session() as s:
- url = "http://www.elitepvpers.com/forum/login.php?do=login"
- pwmd5 = hashlib.md5(Password.encode("UTF-8")).hexdigest()
- p = s.post(url, data={'vb_login_username': Username,'s': '','securitytoken': 'guest','do': 'login','vb_login_md5password': pwmd5,'vb_login_md5password_utf': pwmd5,}, headers={"Referer": "http://www.elitepvpers.com/forum/"})
- r = s.get(fullURL)
- output = open("output.html", "w")
- output.write(r.text.encode("ISO-8859-1", "ignore"))
- output.close()
- #req = requests.post(fullURL, data=payload, headers=headers)
- #print(req.headers)
- #output = open("output.html", "w")
- #output.write(req.text.encode("ISO-8859-1", "ignore"))
- #output.close()
- HTTP = requests.get(fullURL) # Makes a GET request to the formatted URL
- soup = BeautifulSoup(HTTP.text, "html.parser")
- posts = str(soup.find(id="posts"))
- regex = re.findall("\"(|\/\/|http:\/\/)www\.elitepvpers\.com\/forum\/elite-gold-trading\/(.+)\.html\"", posts)
- for poi in regex:
- print(string.joing(poi) + "\n")
- #print(str(posts))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement