I want to crawl the necessary information after logging into the school portal using the requests module.
It's my first time using a request
login ID off duty on the page and post - > a by post - > b, post - Get
the main page >.When it is said that login takes place through the process, if you post your ID password at first, the latter part is automatically
Is it working? But I don't think I can log in.
crawling python
Hi, how are you?
First of all, there is no information about the source code and the target homepage, so let me tell you a conceptual story.
The cookies that were first accessed and delivered must be included when the POST
method is delivered through requests.post
to receive the value later. In addition, you must be bound by one Session
for a series of communications to receive the redirect
page according to login completion.
Yes)
import requests
url = 'target.com/login.asp' #Loginactionpage
data = {'id': by 'howoni', 'pw', ':D'} #postmultipart/form-data
header = {'User-Agent': 'answer'} #html header
r = requests.session() #requestsession
r = requests.get('target.com') #Access target page
c = r.cookies.get_dict() #Importing cookie information in dictionary form for the target.
r = requests.post(url, data, headers=header, cookies=c)
#Deliver post method including header and cookie
print(r.text) #text output for a page that is logged in and redirected
When checking login for Pentest purposes, write it based on the script as above. There is no accurate information in the question, so please refer to it even if it is not an accurate answer.
917 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
620 Uncaught (inpromise) Error on Electron: An object could not be cloned
578 Understanding How to Configure Google API Key
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.