Untitled

mail@pastecode.io avatar
unknown
python
a year ago
2.8 kB
3
Indexable
Never
import requests

cookies = {
    'PHPSESSID': 'kd8r339e2l7mcchse6s7kpt8rg',
    'XSRF-TOKEN': 'eyJpdiI6IjVHSVkzNThzS3ZURTQrMVcrclNHMnc9PSIsInZhbHVlIjoiZkFab2J3ZjRIeThuZ1NaV1l0WkF6bzJwNWJBNHlsYXB2elJkNUM1SXUxc2YwQzVReEo5YmFqN2tlV0J5ejBvWGg2bVZXejFzR2JVTUZiSWFxQis0RkxRMzY0U0VxWmc2KzAwanFtU1Z4L1BpdEg3N3Q0cHJSeEdmbUpCUlo4VCsiLCJtYWMiOiJhZGY1NGIyYTg5YmUyNTA4YzQyMTY5M2VlNmI0YTg2ODQ1MzI3MGVmMGNhMDkyZDE0ZWM3N2ExMTU0MDljNjg5In0%3D',
    'laravel_session': 'eyJpdiI6ImFNSVEydWkvUmhyQVZTbk44cCsxRlE9PSIsInZhbHVlIjoiWG52Ylg5b2g4ZmpWT0wxWGp6RmF0dGVqVmJ6SksxTGE0bm9TSk1qbEY3VzF6YnFGcE5kTVR4c1dxQWRUVXh3cXdTOWNtRVEzL2Q5NTZKVmJEeldmTlRDeDZHREJad1JXTjdLWHNIRFZrdERrL3MzcU1rYUdKZFhZRnpITEoyRTEiLCJtYWMiOiIyNGU0NmY4ZjgxNjVjOWUxZGRhODM3MzNlY2Q1YjU1MjM5Yzc4YmUwYzBhMmJlOGFkYzUzNTE0NjZjMjNjNTk4In0%3D',
}

headers = {
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'Accept-Language': 'en-US,en;q=0.9',
    'Cache-Control': 'max-age=0',
    'Connection': 'keep-alive',
    'Content-Type': 'application/x-www-form-urlencoded',
    # 'Cookie': 'PHPSESSID=kd8r339e2l7mcchse6s7kpt8rg; XSRF-TOKEN=eyJpdiI6IjVHSVkzNThzS3ZURTQrMVcrclNHMnc9PSIsInZhbHVlIjoiZkFab2J3ZjRIeThuZ1NaV1l0WkF6bzJwNWJBNHlsYXB2elJkNUM1SXUxc2YwQzVReEo5YmFqN2tlV0J5ejBvWGg2bVZXejFzR2JVTUZiSWFxQis0RkxRMzY0U0VxWmc2KzAwanFtU1Z4L1BpdEg3N3Q0cHJSeEdmbUpCUlo4VCsiLCJtYWMiOiJhZGY1NGIyYTg5YmUyNTA4YzQyMTY5M2VlNmI0YTg2ODQ1MzI3MGVmMGNhMDkyZDE0ZWM3N2ExMTU0MDljNjg5In0%3D; laravel_session=eyJpdiI6ImFNSVEydWkvUmhyQVZTbk44cCsxRlE9PSIsInZhbHVlIjoiWG52Ylg5b2g4ZmpWT0wxWGp6RmF0dGVqVmJ6SksxTGE0bm9TSk1qbEY3VzF6YnFGcE5kTVR4c1dxQWRUVXh3cXdTOWNtRVEzL2Q5NTZKVmJEeldmTlRDeDZHREJad1JXTjdLWHNIRFZrdERrL3MzcU1rYUdKZFhZRnpITEoyRTEiLCJtYWMiOiIyNGU0NmY4ZjgxNjVjOWUxZGRhODM3MzNlY2Q1YjU1MjM5Yzc4YmUwYzBhMmJlOGFkYzUzNTE0NjZjMjNjNTk4In0%3D',
    'Origin': 'https://www.opcom.ro',
    'Referer': 'https://www.opcom.ro/grafice-ip-raportPIP-si-volumTranzactionat/en',
    'Sec-Fetch-Dest': 'document',
    'Sec-Fetch-Mode': 'navigate',
    'Sec-Fetch-Site': 'same-origin',
    'Sec-Fetch-User': '?1',
    'Upgrade-Insecure-Requests': '1',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
    'sec-ch-ua': '"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
}

data = {
    '_token': 'RI9RMBFz3ct20rDDJxh9ovWsG951aZE11d26GSIs',
    'day': '20',
    'month': '03',
    'year': '2023',
    'buton': 'Refresh',
}

response = requests.post(
    'https://www.opcom.ro/grafice-ip-raportPIP-si-volumTranzactionat/en',
    cookies=cookies,
    headers=headers,
    data=data,
)