0

I was trying to submit details through python on a form on the following website.

I tried requests but there is a search box on the site as well(another form).

How do I handle this? Sample data - TIN - 27680809621V

2 Answers 2

1

Try selenium or BeautifulSoup libraries

Sign up to request clarification or add additional context in comments.

1 Comment

How about providing an example in your answer. Right now your 'answer' is more of a comment than an actual answer.
0

Try using Mechanize, a library that supports interacting with forms, links and others when crawling or scraping data.

Something like this would be enough:

import mechanize
br = mechanize.Browser()
br.open('http://mahavat.gov.in/Tin_Search/Tinsearch.jsp')
br.select_form('f1')
br.form['tin'] = '27680809621V'
br.submit()

Here are some examples from StackOverflow on how to use Mechanize to fill forms:

2 Comments

If you are just going to recommend a library and link other answers on this site, why not comment and flag for duplication. Also this feels more of a comment than an answer.
I tried mechanize. I had problems with it. import mechanize br = mechanize.Browser() url = 'mahavat.gov.in/Tin_Search/Tinsearch.jsp' br.open(url) br.select_form(name='f1') It gave me the following error - TypeError: parse() got an unexpected keyword argument 'transport_encoding'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.