Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8553473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:39:37+00:00 2026-06-11T14:39:37+00:00

I am trying to download some documents using requests, but the page is redirecting

  • 0

I am trying to download some documents using requests, but the page is redirecting me to a userlog in screen and therefor downloading the HTML page.

I’ve tried doing:

c=requests.get(url,auth=HTTPBasicAuth('user','pass'))

But I’m not getting authenticated.

I’ve also tried vanilla and Digest.

The form itself looks like this:

<input id="username" name="username" class="required" tabindex="1" type="text" value="" size="25" autocomplete="false"/>
<br/>

<label for="password">Password</label>
<input id="password" name="password" class="required" tabindex="2" type="password" value="" size="25" autocomplete="off"/>

Do I need to pass in the username and password as a part of the payload? If so, how do I do that? I’ve tried a few different ways so far.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:39:39+00:00Added an answer on June 11, 2026 at 2:39 pm

    Basically, it had to do with grabbing the authentication ID off the page and passing in cookies.

    This is basically what I did:

    from bs4 import BeautifulSoup as bs
    import requests
    s = requests.session()
    url = r'url_i_care_about'
    
    def authenticate(s, url):
        headers = {'username': 'myuser', 'password': 'mypasss', '_Id': 'submit'}
        page=s.get(url)
        soup=bs(page.content)
        value=soup.form.find_all('input')[2]['value']
        headers.update({'value_name':value})
        auth = s.post(url, params=headers, cookies=page.cookies)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to download some data using pure javascript/html from cross-domain, dropbox to be
I'm trying to download some files with PHP & CURL, but I don't see
I am trying to download some PDF's automatically on a site ( http://bibliotecadigitalhispanica.bne.es )
I am trying to do download some images from server then , set these
Im trying to download share data from a stock exchange using python. The problem
I am trying to download a file from a website using python and mechanize.
I'm trying to download the XLS file from this page: http://www.nordpoolspot.com/Market-data1/Elspot/Area-Prices/ALL1/Hourly/ (click on Export
I'm trying to download a directory, using FTP in a C# application. I basically
I've been trying to write an application, using Qt and mingw32, to download images
I am planning to create a screen saver. Thinking of trying out some WPF

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.