Jump to content

Recommended Posts

Posted

Hi all,

 

Currently trying to create a new ETL pipeline for database and trying to scrape all employees using the SAGE HR api , there are two pages of empoloyees but when I enter page=2 into the link I am getting an error saying it doesn't exist?

 

included are the link as present in the code  typed, the meta data from the first page and finally the returned value when I call page 2.

 

This is pulled and augmented from the documentation. It works for page 1. 

sage_hr_request = requests.get('https://COMPANYNAMEPLACEHOLDER.sage.hr/api/employees?pages=2&team_history=true&employment_status_history=true&position_history=true',headers=headers)

Meta data states there are 2 pages but cant access the second page

 

"meta":{"current_page":1,"next_page":2,"previous_page":null,"total_pages":2,"per_page":50,"total_entries":84}}

 

finally this is the response when page 2 is called


<body>
<div class="page">
    <div class="logo404">
        <img style="width: 120px;" src="/sage_logo_black.svg" alt="">
    </div>
    <div class="dialog">
        <a href="/">
            <img style="width: 450px; max-width: 100%;" src="/404.png" alt="Page not found"/>
        </a>

        <h1>
            Ooops,
            <br>
            this page doesn't exist...
        </h1>

        <h2>
            Head back <a href="/">home</a>
        </h2>
    </div>
</div>
</body>
</html>

Coding in python 3 using URLLIB.REQUEST, have API key access and as previously stated works for page one 

 

any help would be appreciated!

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...