P
P
Peter Pitaev2020-08-25 21:32:47
Python
Peter Pitaev, 2020-08-25 21:32:47

Request python requests, implementation of focus on the page (possible by other methods)?

Hello.

Sending a request to a page with python requests:

import requests
proxies = {"http": "http://gdfdafgg:[email protected]:74654/","https": "http://gdfdafgg:[email protected]:74654/"}
r = requests.get("https://site.com/", proxies=proxies)
print(r.content)


Page example:
5f4558302541a680768685.png

When entering the page, instead of the time, it says Loading... in a second, a countdown appears.
If you do it through the browser, then everything is ok. And when requested using python Loading ... does not disappear.
The proxy works, that's not the point.

I learned this with the help of:
print(r.content)

Please direct me on the right path, thanks)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
kirillinyakin, 2020-08-25
@XXocTT

As I understand it, based on the question, requests immediately receive a response, without waiting for the processing of JS scripts, there is Selenium for this

D
Dr. Bacon, 2020-08-25
@bacon

requests is only about html, she knows nothing about js

S
soremix, 2020-08-25
@SoreMix

The timer is powered by JS. Use selenium

A
Alexander, 2020-08-25
@AlexPyth

If you want to implement receiving data after the countdown only through requests, then track all requests using the developer mode in the browser, find patterns and already send these requests using the requests library. Good luck

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question