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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:20:58+00:00 2026-05-26T01:20:58+00:00

I want to select a form with mechanize. This is my code: br =

  • 0

I want to select a form with mechanize. This is my code:

br = mechanize.Browser()
self.br.open(url)
br.select_form(name="login_form")

The form’s code:

<form id="login_form" onsubmit="return Index.login_submit();" method="post" action="index.php?action=login&server_list=1">

But I’m getting this Error:

mechanize._mechanize.FormNotFoundError: no form matching name 'login_form
  • 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-26T01:20:59+00:00Added an answer on May 26, 2026 at 1:20 am

    The problem is that your form does not have a name, only an id, and it is login_form. You can use a predicate:

    br.select_form(predicate=lambda f: f.attrs.get('id', None) == 'login_form')
    

    (where you se if f.attrs has the key id and, if so, the id value is equal to login_form). Alternatively, you can pass the number of the form in the page, if you know if it is the first one, the second one etc. For example, the line below selects the first form:

    br.select_form(nr=0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to scrape this web page using Mechanize. The form element looks like
I have a form select statement, like this: = f.select :country_id, @countries.map{ |c| [c.name,
I want to make an HTML form with 2 select boxes. The selected option
I have a form and I want to add a select location option. How
Struggling with CSS selector. Want to select all FORM elements that are ancestors of
I want to re-populate (i.e refill) values posted from a select form field after
I have a select form field that I want to mark as readonly, as
As the title says, I want the ‘select file’ dialog to open when a
I am working on a multi-select drop-down menu mentioned below <select class=form-input name=hideLineItemColumns_quote multiple=true
I want to use a form select-field for users to select their country of

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.