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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:41:13+00:00 2026-05-13T00:41:13+00:00

I am ready to run this code but before I want to fix the

  • 0

I am ready to run this code but before I want to fix the exception handling:

for l in bios:
    OpenThisLink = url + l
    try:
        response = urllib2.urlopen(OpenThisLink)
    except urllib2.HTTPError:
        pass
    bio = response.read()
    item = re.search('(JD)(.*?)(\d+)', bio)
    ....

As suggested here, I added the try...except but now if a page doesn’t open I get this error:

bio = response.read()
NameError: name 'response' is not defined

So the program continues to execute. Instead I want it to go back to the for loop and try the next url. I tried break instead of pass but that ends the program. Any suggestions?

  • 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-13T00:41:13+00:00Added an answer on May 13, 2026 at 12:41 am

    Use continue instead of break.

    The statement pass is a no-op (meaning that it doesn’t do anything). The program just continues to the next statement, which is why you get an error.

    break exits the loops and continues running from the next statement immediately after the loop. In this case, there are no more statements, which is why your program terminates.

    continue restarts the loop but with the next item. This is exactly what you want.

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

Sidebar

Related Questions

the code below is working, but I want to make sure it's correct .
i have this in my content page: but i am getting null value if
Here is what i want to do - run a series of jQuery animations
I've developed a .NET 4 software and I'm ready to send it to beta
I have page that has some javascript that needs to run at page load.
I am implementing run length encoding using the GZipStream class in a C# winforms
I need to do run a simple two-stage least squares regression on large data
I have a combo box and several text boxes on a form. When I
I have read all the blog posts on digital signing and checked out GoDaddy
During development, I'd like to have an XML file in my iPhone app's Documents

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.