I am trying to login to a page and access another link in the page.
payload={'username'=<username>,'password'=<password>} with session() as s: r = c.post(<URL>, data=payload) print r print r.content
This is giving me a “405 Not Allowed” error. I checked the post method details using chrome developer tools and could see an api (URL/api/auth). I posted to that URL with the payload and it was working and i was getting a response similar to what i could see in the developer.
Unfortunately when trying to ‘get’ another url after login, i am still getting the content from the login page. Why is the login not sticking? Should i use cookies? I am a newbie, so i don’t really know how to work with cookies.
Related Posts:
- ImportError: No module named requests
- Importing requests module does not work
- How to POST JSON data with Python Requests?
- Max retries exceeded with URL in requests
- Using headers with the Python requests library’s get method
- Using headers with the Python requests library’s get method
- ImportError: No module named ‘Queue’
- Download large file in python with requests
- Getting
with Python http requests instead of INT - Python Requests – No connection adapters
- Unable to resolve ‘requests’. IntelliSense may be missing for this module. Visual Studio/Python
- Can I set max_retries for requests.request?
- Python requests SSL error – certificate verify failed
- Find the current directory and file’s directory [duplicate]
- Finding the index of an item in a list
- What does the list() function do in Python?
- raw_input function in Python
- How to execute a program or call a system command?
- Adding new column to existing DataFrame in Python pandas
- TypeError: can’t multiply sequence by non-int of type ‘str’
- Error:cannot convert float NaN to integer in pandas
- What does the % sign mean in coding?
- Replacing column values in a pandas DataFrame
- How can I count the occurrences of a list item?
- Unable to plot Double Bar, Bar plot using pyplot for ndarray
- matplotlib error – no module named tkinter
- AttributeError: module ‘urllib3’ has no attribute ‘urlopen’ in python
- How to download a file over HTTP?
- filedialog, tkinter and opening files
- How do I get the row count of a Pandas DataFrame?
- Singular matrix issue with Numpy
- TypeError: ‘dict’ object is not callable
- Error in Python script “Expected 2D array, got 1D array instead:”?
- Get list from pandas dataframe column or row?
- main loop ‘builtin_function_or_method’ object is not iterable
- pg_config executable not found
- error: Failed to load the native TensorFlow runtime
- How do I check if a list is empty?
- List files ONLY in the current directory
- Exit codes in Python
- how can I translate efficiently a Java code to python?
- ImportError: No module named ‘encodings’
- how does \r (carriage return) work in Python
- How to prompt for user input and read command-line arguments
- What is Python buffer type for?
- Empty set literal?
- How can I check file size in Python?
- Any way to clear python’s IDLE window?
- Shuffle DataFrame rows
- What is the point of float(‘inf’) in Python?
- How can I splice a string?
- How to declare array of zeros in python (or an array of a certain size)
- How to convert string to byte array in Python
- gaierror: [Errno 8] nodename nor servname provided, or not known (with macOS Sierra)
- Converting int to bytes in Python 3
- Plot a horizontal line using matplotlib
- How to reinstall a pip package even if it exists
- Catch multiple exceptions in one line (except block)
- How to get the current working directory using python 3?
- Two dimensional array in python
- printing a two dimensional array in python
- Python sockets error TypeError: a bytes-like object is required, not ‘str’ with send function
- Error NameError: name ‘np’ is not defined
- How to open a file for both reading and writing?
- Pipenv: Command Not Found
- Mapping over values in a python dictionary
- ImportError: no module named win32api
- Remove quotes from String in Python
- How to change plot background color?
- ImportError: No module named ‘bottle’ – PyCharm
- Creating files and directories via Python
- Python dictionary from an object’s fields
- Split a python list into other “sublists” i.e smaller lists
- Official abbreviation for: import scipy as sp/sc
- Colon (:) in Python list index [duplicate]
- Call Python function from JavaScript code
- What does “& 0x7fffffff” mean in “int(time.time()*1000.0) & 0x7FFFFFFF”
- How to compare individual characters in two strings in Python 3
- Unsupported operand type(s) for +: ‘float’ and ‘str’ error
- Plotting multiple lines, in different colors, with pandas dataframe
- Plot a histogram such that the total area of the histogram equals 1
- pip throws TypeError: parse() got an unexpected keyword argument ‘transport_encoding’ when trying to install new packages
- How to change legend size with matplotlib.pyplot
- An equivalent function to matplotlib.mlab.bivariate_normal
- Float must be a string or a number?
- Play audio with Python
- Inheritance and init method in Python
- In Python, is there an elegant way to print a list in a custom format without explicit looping?
- “Python version 2.7 required, which was not found in the registry” error when attempting to install netCDF4 on Windows 8
- Does tkinter have a table widget?
- Releasing memory in Python
- Text progress bar in terminal with block characters
- Generator expression must be parenthesized if not sole argument
- Get a Try statement to loop around until correct value obtained
- Does python have header files like C/C++?
- Making a POST call instead of GET using urllib2
- Extract first and last row of a dataframe in pandas
- How to print both strings in a dictionary in Python
- Python: OSError: [Errno 2] No such file or directory: ”
- bound method Response.json of Response [200]