P
P
Python Newbie2021-11-04 10:25:14
Python
Python Newbie, 2021-11-04 10:25:14

How to catch GET request from browser to server in selenium python?

I have two such requests: publicKey?timestamp=1636010266715, publicKey?timestamp=1636010265363

5SJ1ymMf.jpg?download=1&name=%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%2004-11-2021%2010:20 :36.jpg

I don't know what the numbers will be, so I need to get a request that is higher and whose name contains publicKey.

This is what the response to the request looks like: publicKey: "6*drVtEU*******QauUXqN*****QAQIe"

How do I get the publickKey value?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-11-04
@Levman5

It's just a timestamp (which the name of the parameter hints at), so it doesn't matter what they are there.
Under the asterisks is clearly a Google key, I will assume that it is from captcha. The sitekey won't change every day, so you can just take it as a constant and not parse it every time.
If you want to get the key every time, then it would be better to just send a request to the same endpoint via requests. Or create and send XHR via JS and execute_script(). If you want to see the request log - selenium-wire

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question