I\'ve been in the process of making an instagram bot for a few days now and I\'m having trouble logging into instagram with a headless selenium browser.
The script I mad
This error message...
{u'source': u'network', u'message': u'https://www.instagram.com/accounts/login/ajax/ - Failed to load resource: the server responded with a status of 400 ()', u'timestamp': 1546536937734, u'level': u'SEVERE'}
...implies that the WebDriver was unable to initiate/spawn a new WebBrowsing Session as it failed to load the required resources through AJAX calls.
As per the HTML DOM of the Instagram - Log in page it is pretty clear the DOM Tree contains AJAX and JavaScript enabled elements.
So while you invoke get() method before interacting with the elements on the particular you need to induce WebDriverWait for the desired elements to be clickable which will ensure that:
click events propogated through Selenium.You can find a relevant discussion in Google adsense responding the server responded with a status of 400 ()
Here you can find a relevant discussion on Filling in login forms in Instagram using selenium and webdriver (chrome) python OSX