Pass 403 forbidden error for instagram automation with python

Job Description:


I have a python code which makes automatic posts to instagram. For this code to work, I have to provide session id and csrf token.

Previously, I was using below code to get that. Now, I get 403 forbidden error. I tried many ways, including Node, Selenium, etc. but couldn't solve this problem. I am using a local proxifier by the way. I was also using a proxifier previously. I need someone who will help me to pass this problem.

def main_get_csrf_token():

link = '[login to view URL]'

login_url = '[login to view URL]'

time = int([login to view URL]().timestamp())

payload = {


'enc_password': f'#PWD_INSTAGRAM_BROWSER:0:{time}:{INSTAGRAM_PASSWORD}',

'queryParams': {},

'force': 'False',

'optIntoOneTap': 'False',

'two_step_verificator': 'True',


login_header = {

"User-Agent": "Chrome/77.0.3865.120",

#"User-Agent": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36",

"X-Requested-With": "XMLHttpRequest",

"Referer": "[login to view URL]",

#"x-csrftoken": csrf


login_response = [login to view URL](login_url, data=payload, headers=login_header)

json_data = [login to view URL]([login to view URL])

if json_data["authenticated"]:

print("login successful")

cookies = [login to view URL]

cookie_jar = cookies.get_dict()

csrf_token = cookie_jar['csrftoken']

print("csrf_token: ", csrf_token)

session_id = cookie_jar['sessionid']

print("session_id: ", session_id)


print("login failed ", [login to view URL])

Навыки: Python, Архитектура ПО, PHP, Linux, Веб-скрейпинг

О клиенте:
( 35 отзыв(-а, -ов) ) Ankara, Turkey

ID проекта: #35275013

8 фрилансеров(-а) готовы выполнить эту работу в среднем за $20


Hello, Greetings Ferda S., Good afternoon! I am an expert web developer with skills including Linux, Web Scraping, Software Architecture, Python and PHP. "login failed " Please contact me to discuss more regarding Больше

$25 USD за 1 день
(39 отзывов(-а))

Hey! I am skilled Python engineer with skills including Linux, PHP, Software Architecture, Web Scraping and Python. - web scraping, data mining, data extraction, data transformation, - writing scripts and utilities, - Больше

$30 USD за 4 дней(-я)
(56 отзывов(-а))

Hello, I examined your project description, and I confirm I can handle those tasks perfectly, as I am an expert in PHP, Python, Linux, Web Scraping, Software Architecture. I am prepared to handle projects requiring Больше

$10 USD за 7 дней(-я)
(59 отзывов(-а))

Greetings, I have gone through your project description. I find myself as a perfect fit for this job. I am working as a Python Developer from last 2 year. Some of my expertise is in the fields: 1. Web Scraping/Web Au Больше

$20 USD за 3 дней(-я)
(49 отзывов(-а))

⭐⭐⭐I can start now and I am confident that I can do it ⭐⭐⭐ I have 10 years of experience in this field and I have these skills (PHP, Linux, Web Scraping, Software Architectureand Python) so just check my reviews and pl Больше

$20 USD за 5 дней(-я)
(11 отзывов(-а))

I will fix error. I have all skills required for the task. Please let me know when I can start. Regards, Anoop

$15 USD за 7 дней(-я)
(5 отзывов(-а))

I have 5+ years experience in python programming language and 3+ years experience in django, I have been mentoring cyber security in Uzbekistan for 3+ years I think I can make you work

$20 USD за 7 дней(-я)
(0 отзывов(-а))

Hello Mate!Greetings Ferda S., Good morning! I’ve carefully checked your requirements and really interested in this job. I’m offering best quality and highest performance at lowest price. I can complete your project Больше

$21 USD за 2 дней(-я)
(0 отзывов(-а))