Re: cannot download mbox with python

Поиск
Список
Период
Сортировка
От Andreas 'ads' Scherbaum
Тема Re: cannot download mbox with python
Дата
Msg-id 25b24513-cf6f-406e-a04e-b3d834ad5398@pgug.de
обсуждение исходный текст
Ответ на Re: cannot download mbox with python  (Pierre Forstmann <pierre.forstmann@gmail.com>)
Список pgsql-www
On 07/12/2023 17:39, Pierre Forstmann wrote:
I've tried this:

import requests
from urllib.parse import urlparse

url = 'https://www.postgresql.org/list/pgsql-bugs/mbox/pgsql-bugs.202312'
#response = requests.get(url, auth=('xxx','yyy'))
session = requests.session()
session.auth = ('xxx','yyy')
response = session.get(url)
print('status: ' + str(response.status_code))
print('... done')
print(response.content)

The session.auth is still doing a basic http auth, not what you need here.

Try opening your link in a browser in an anonymous window:

https://www.postgresql.org/list/pgsql-bugs/mbox/pgsql-bugs.202312

It redirects you to the login, you need to emulate that path in your script,
login into the website and then you can retrieve the mbox.

-- 				Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project

В списке pgsql-www по дате отправления:

Предыдущее
От: Pierre Forstmann
Дата:
Сообщение: Re: cannot download mbox with python
Следующее
От: Guillaume Lelarge
Дата:
Сообщение: Patch for new book edition