A
A
Anton2015-11-29 12:12:58
Python
Anton, 2015-11-29 12:12:58

Is it possible to set the region for which the URL will be opened in Requests?

The solution is of interest in relation to the directory . I am using the Requests library .
After a request is made, the resulting content changes periodically. That corresponds to my city, then another city.

import requests
r = requests.get('http://www.svyaznoy.ru/catalog/flash/230')

How to set the region for which you want to get data?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2015-11-29
@Gambetto

1) set the city
2) look at the cookies for it
3) use cookies in the request

R
Roman Kitaev, 2015-11-29
@deliro

See how the city is saved and simulate it in requests. Maybe it's a cookie, maybe (but unlikely) a snapshot of request.META, maybe something else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question