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

  • SEARCH
  • Home
  • 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 8118711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:34:43+00:00 2026-06-06T04:34:43+00:00

I found out how to retreive the html page of a topic from google

  • 0

I found out how to retreive the html page of a topic from google search using a tutorial.This was given in the tutorial.

import mechanize
br = mechanize.Browser()
br.open('http://www.google.co.in')
br.select_form(nr = 0)

I understood till this that it retrieves the form.Then it was given that

br.form['q'] = 'search topic'
br.submit()
br.response.read()

This does output the html of the page related to the search topic.
But my doubt is what should this parameter in br.form[parameter] be? Because I tried it for Google News and it gave a successful result.Can someone help me out?

  • 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-06T04:34:45+00:00Added an answer on June 6, 2026 at 4:34 am

    It’s the id of the form field, as given in the page source.

    You can get the available id values like so:

    import mechanize
    
    br = mechanize.Browser()
    br.open("http://www.google.com/")
    
    for f in br.forms():
        print f
    

    which gives me:

    <f GET http://www.google.ca/search application/x-www-form-urlencoded
      <HiddenControl(ie=ISO-8859-1) (readonly)>
      <HiddenControl(hl=en) (readonly)>
      <HiddenControl(source=hp) (readonly)>
      <TextControl(q=)>
      <SubmitControl(btnG=Google Search) (readonly)>
      <SubmitControl(btnI=I'm Feeling Lucky) (readonly)>
      <HiddenControl(gbv=1) (readonly)>>
    

    which says that:

    1. There is only one form on the page

    2. Hidden field id’s are ie (page encoding), hl (language code), hp (? don’t know), and gbv (also don’t know).

    3. The only not-hidden field id is q, which is a text input, which is the search text.

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

Sidebar

Related Questions

I found out jQuery does not always create the correct DOM from an HTML
I found out this morning that proc.new works in a class initialize method, but
I found out how to sort a JSON array at http://www.devcurry.com/2010/05/sorting-json-array.html Now I want
I was using the following code to retrieve HTML snippets from a database table
I downloaded a WavFile package from http://www.labbookpages.co.uk/audio/javaWavFiles.html Using which i wanted to read the
I have been coding around with Google Geocoding until I found out that the
I have a problem in getting some data out from Cassandra using c# and
I found out about GWT's CustomScrollPanel and how you can customize the scroll bar,
I found out that it is possible to open the windows explorer with a
I found out opencv sample face detection example for android but it is detecting

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.