1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

403 Forbidden: The server understood the request, but is refusing to fulfill it.

Discussion in 'Twitter' started by guybrushthreepwood, Mar 18, 2015.

  1. guybrushthreepwood

    guybrushthreepwood Regular Member

    Joined:
    Oct 21, 2013
    Messages:
    203
    Likes Received:
    13
    I wrote a selenium / python script that creates twitter accounts for me.

    When it presses the submit button I get this error: "403 Forbidden: The server understood the request, but is refusing to fulfill it."

    Waiting, chaning ip, clearing cookies et does not solve the problem.

    Any idea how to ork around this?

    thx ☺
     
  2. papercut

    papercut Junior Member

    Joined:
    Feb 22, 2015
    Messages:
    135
    Likes Received:
    7
    403 error means forbidden, have you given it permission to execute? chmod +x file.py
     
  3. guybrushthreepwood

    guybrushthreepwood Regular Member

    Joined:
    Oct 21, 2013
    Messages:
    203
    Likes Received:
    13
    the error comes from the twitter website...
     
  4. papercut

    papercut Junior Member

    Joined:
    Feb 22, 2015
    Messages:
    135
    Likes Received:
    7
    Okay - this were not stated in the OP.
     
  5. jamie3000

    jamie3000 Supreme Member

    Joined:
    Jun 30, 2014
    Messages:
    1,311
    Likes Received:
    586
    Occupation:
    Finance coder looking for semi-retirement
    Location:
    uk
    That is odd. If you're using selenium then you should be posting exactly what the server is expecting. You're not bypassing the client side validation in anyway are you? Also I remember having to set the user agent to chrome when using phantomjs, not sure if I had to do anything like that with selenium.
     
  6. jamie3000

    jamie3000 Supreme Member

    Joined:
    Jun 30, 2014
    Messages:
    1,311
    Likes Received:
    586
    Occupation:
    Finance coder looking for semi-retirement
    Location:
    uk
    Also are you using 100â„… different data each time? Eg different user name after a 403. Server might blacklist that username if it thinks its being automated
     
  7. seogootwit

    seogootwit Registered Member

    Joined:
    Apr 13, 2012
    Messages:
    96
    Likes Received:
    27
    Location:
    Sydney
    Did you find a solution for this. Same thing happens to me using the Twitter Intent URL with capserjs/slimerjs but everything else I do works fine.
     
  8. whiteroot

    whiteroot Junior Member

    Joined:
    Oct 22, 2015
    Messages:
    102
    Likes Received:
    32
    Gender:
    Male
    Occupation:
    Software engineer, freelancer
    Location:
    France
    I had this problem from time to time with my own script.
    What I found while debugging is I missed sending something when posting data
    check that you post a valid user-agent, a referer, all the fields found in the form (especially the authenticity token), the cookie
    you must convince Twitter you use a normal browser
    its 403 response means you didn't