Skip to content
Advertisement

How can I get this POST request to execute in Python using Google Colab. I am currently getting a 400 response code

I am trying to extract information for all the jobs on this website: https://www.americanmobile.com/travel-nursing-jobs/search/

Looking at the network activity tab, it looks like all the data I need comes from a POST request made here: https://jobs.amnhealthcare.com/api/jobs//search. I have attached an image that may help confirm exactly what I am referencing. example_1

I wrote the following code in Google Colab to try to at least get the first 10 results. Referencing python requests POST with header and parameters, I know a lot of the headers may not even be necessary. I have tried sending this request without any headers at all.

Is what I’m trying to do even possible? I have only gotten a 400 response code so far.

If it is possible to accomplish this, is it possible to extract this information for all 4k + jobs?

JavaScript

Thank you

Advertisement

Answer

The formatting of your data wasn’t entirely correct. This should work:

JavaScript

You can now adapt JobsPerPage and PageNumber to retrieve all the posts you need in a for-loop.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement