Failed to load resource: the server responded with a status of 400 () while trying to login into Instagram through Selenium and Python

后端 未结 1 1723
忘掉有多难
忘掉有多难 2021-01-28 16:55

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

相关标签:
1条回答
  • 2021-01-28 17:34

    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:

    • The associated JavaScript and AJAX Calls have completed
    • The desired elements are enabled and visible to recognize 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

    0 讨论(0)
提交回复
热议问题