raceback (most recent call last):
File "d:\Serega\Python\olx_parser\test.py", line 19, in <module>
r = requests.get(
File "C:\Users\Dom\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\Dom\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\Dom\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Dom\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\Dom\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 510, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='whatismyipaddress.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 400 Bad Request')))
from bs4 import BeautifulSoup
import requests
headers = {
'Accept':'*/*',
'Host': 'www.olx.ua',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode ': 'cors',
'Sec-Fetch-Site': 'same-origin',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0',
'X-Platform-Type': 'mobile-html5',
'Authorization': 'Bearer 6c8bea54aaecbbabfcbdadf99feb845781026be5',
}
proxy = {
'https': 'http://185.171.230.151:80'
}
r = requests.get(
'https://whatismyipaddress.com/',
headers=headers,
proxies=proxy
).text
soup = BeautifulSoup(r, 'lxml')
print(soup.find('span', class_='address'))