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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:12:54+00:00 2026-05-22T21:12:54+00:00

I am using mechanize module to retrieve information from a web page. It has

  • 0

I am using mechanize module to retrieve information from a web page. It has a radio control section which I select before moving to the next page. I could easily select the value by assigning value to it. But coulnt retrieve the value of the candidate radio button. RadioSelect part of my form looks like below:

<RadioControl(rdoSelect=[1634,ABX EXPRESS, 16650,XYZ EXP])>

I could easily set the values by:

br.form['txtSource']='1634,ABX EXPRESS'

What I want is to retireve the list :

[1634,ABX EXPRESS, 16650,XYZ EXP]

UPDATE:

When I gave

print br.form['rdoSelect']

It gives [] as result

I could get the value using

print br.form.possible_items("rdoSelect")

But its giving me this

/usr/lib/python2.5/site-packages/ClientForm.py:2984: DeprecationWarning: [item.name for item in self.items]
  return c.possible_items(by_label)
  • 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-22T21:12:55+00:00Added an answer on May 22, 2026 at 9:12 pm

    Instead of:

    print br.form.possible_items("rdoSelect")
    

    mechanize says to use:

    options = [item.name for item in form.find_control('rdoSelect').items]
    

    Example use:

    #!/usr/bin/python
    import re
    import mechanize
    br = mechanize.Browser()
    r = br.open("http://www.htmlcodetutorial.com/forms/_INPUT_TYPE_RADIO.html")
    form = mechanize.ParseResponse(r, backwards_compat=False)[2]
    options = [item.name for item in form.find_control('pizzasize').items]
    print options
    

    Yields:

    ['S', 'M', 'L']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using mechanize to login into a website and then retrieve a page. I'm
I'm trying to use WWW::Mechanize to extract some links from the HTML page using
I want to scrape this web page using Mechanize. The form element looks like
I've encountered the Iconv::IllegalSequence error on some web pages when using mechanize lib. Is
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
I am using www-mechanize module to access website controls. Some html pages contains frames.
I am using an http proxy and the Mechanize module. I initialize the mechanize
I'm using Mechanize and Beautiful soup to scrape some data off Delicious from mechanize
I've written the following in python using the mechanize module in order to print
I am navigating a site using python's mechanize module and having trouble clicking on

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.