Files
DBAdmin/inbox/Python/i.py
T
2026-05-18 06:40:19 +00:00

19 lines
1.2 KiB
Python

import requests
import bs4 as bs
with requests.session() as c:
link="https://edu.gotoit.pl/wp-login.php" #link of the webpage to be logged in
initial=c.get(link) #passing the get request
login_data = {"log": "pawel.domanski@outlook.com","pwd": "sisuCeqExO",
"rememberme": "forever",
"redirect_to": "https://edu.gotoit.pl/index.php/narzedzia-i-kursy-marketingowe-z-ai-atlas-promptow-chatgpt-marketing/marketing/generowanie-pomyslow-na-rabaty//",
"redirect_to_automatic": "1"
}#the login data from any account on the site. Stars must be replaced with username and password
page_login = c.post('https://gpldl.com/wp-login.php', data=login_data)#posting the login data into the link
print(page_login) #checking status of requested page
page=c.get("https://edu.gotoit.pl/index.php/narzedzia-i-kursy-marketingowe-z-ai-atlas-promptow-chatgpt-marketing/marketing/generowanie-pomyslow-na-rabaty/") #requesting source code of logged in page
good_data = bs.BeautifulSoup(page.content, "lxml") #parsing it with BS4
print(good_data.title) #printing this gives the title that is got from the page when accessed from an logged-out account