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 6337071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:10:56+00:00 2026-05-24T19:10:56+00:00

i am working on a little script grabbing some files from a website. First

  • 0

i am working on a little script grabbing some files from a website. First i create a list of potential urls within the website. This worked fine with Python 3.1 but not with Python 3.2. I guess it is a question on encoding but i am not sure how to realise it in an elegant way. Can you help me?

def get_urls(username, password, userid):
    cj = http.cookiejar.CookieJar()
    opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
    login_data = urllib.parse.urlencode({'login' : username, 'password' : password})
    opener.open(BASE_URL+"/bg/login", login_data)
    url = BASE_URL + "/bg/user/" + userid + "?finished=1"
    resp = opener.open(url)
    result = resp.read()
    txt = result.decode("iso-8859-1")
    liste = (re.findall("/bg/export/[\d]{4,8}",txt))
    return liste
  • 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-05-24T19:10:56+00:00Added an answer on May 24, 2026 at 7:10 pm

    The problem should be here:


    login_data = urllib.parse.urlencode({'login' : username, 'password' : password})
    opener.open(BASE_URL+"/bg/login", login_data)

    urllib.parse.urlencode outputs string not an iterable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a little backup script from some firebird databases and
I'm having little trouble creating a script working with URLs. I'm using urllib.urlopen() to
I was working on a little script that would do some logging for me
My little script isn't working, I can't figure this out... If you echo 'true';
I'm trying to use this little script I found here , but for some
I am working on a simple email importer script. From what posts on this
I've been working a little with DevExpress CodeRush and Refactor! Pro this week, and
I'm trying to get this piece of code working a little better. I suspect
I am working on a little Perl module and for some reason I had
I am working on little script and made wrong decision to do it in

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.