Can't parse the username to make sure I'm logged in to a website

前端 未结 2 693
既然无缘
既然无缘 2021-01-17 23:33

I\'ve written a script in python to log in to a website and parse the username to make sure I\'ve really been able to log in. Using the way I\'ve tried below seems to get me

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-18 00:10

    Seems like you are copying the cookies from browser, so here i'll go with this theory.

    The first post api you hit, sets some cookies, returns a page, which calls some further urls, which set more cookies, and this goes on. Try checking all the requests in the network tab to see if there are multiple calls, which set different cookies.

    If there are, you need to call all of them in the order they are called in the page, each call adding new cookies, and then, finally you should be able to see all the cookies that you are copying.

    However, if a random data is being calculated and sent in any of the calls, it might be for csrf protection or bot protection, in which case, you are better off using http://www.omdbapi.com/ or https://imdbpy.github.io/ to access official APIs instead of internal ones.

提交回复
热议问题