Hey guys basically I have a website than I am an admin for, but do not have access to the source. We have an manual ban list for people who grief in our game. The site is hosted and ends in .php.
There is one dude who always puts iQ55 in his name who ruins matches and creates many many new accounts to get around the ban.
There is a page which does not require a login that shows who is currently in the games that is updated in real time.
My plan was to webscape that page and find any string containing the letters "IQ55" and add that name to the banlist. To do this I must log in to my admin account and to do this with my current knowledge it doesnt work with any site ending in .php.
My script I am using works with logging into github and my university portal so I know it works just not for .php as I cannot view the source.
from bs4 import BeautifulSoup
import mechanicalsoup
user2 = "XXXXXXXX"
pass2 = "XXXXXXXX"
browser = mechanicalsoup.Browser(soup_config={'features': 'lxml'})
# request github login page. the result is a requests.Response object
# http://docs.python-requests.org/en/latest/user/quickstart/#response-content
login_page = browser.get("https://XXXXXXXX.eu/bancp/bancp.php")
# similar to assert login_page.ok but with full status code in case of
# failure.
login_page.raise_for_status()
# login_page.soup is a BeautifulSoup object
# http://www.crummy.com/software/BeautifulSoup/bs4/doc/#beautifulsoup
# we grab the login form
login_form = mechanicalsoup.Form(login_page.soup.select_one('#login'))
# specify username and password
login_form.input({"username": user2, "password": pass2})
# submit form
page2 = browser.submit(login_form, login_page.url)
print(page2.soup.get_text())
I am using the Mechanical Soup module along with BeautifulSoup.
If this cannot be done can I get some pointers on where to go from here.
Broken down
*get all words containing "xxxx" from one page
*add all words to banlist on page that requires login and ends in .php
EDIT: it appear ending in PHP isnt the issue its just getting past this page using python. https://i.stack.imgur.com/PBM8o.jpg