0

I am making a python program that automatically enters information into a form on a website. I looked at a module called mechanize at first but then I realized that it didn't support javascript. Is there any way to take a piece of information and insert it into a "form" on a website that uses javascript?

The website I am using is www.locationary.com.

If you login and then go to a place/business page like this,

http://www.locationary.com/place/en/US/California/Los_Angeles/Z_Pizza-p1001157911.jsp

then you will see a bunch of spots that need to be filled in. I looked at the page source and this "form" uses javascript. I just need a way to fill in those blanks now. Like I said, I tried mechanize and it didn't work but I also googled it and got nothing.

The "form" uses "onclick"

If you could offer any advice, I would really appreciate it.

Thanks.

6
  • To really do this you need an environment that makes the page think it's really in a web browser. Generally that's sufficiently hard that people go the route of harnessing an actual browser somehow. Commented Dec 22, 2011 at 21:47
  • I just found something called Selenium..would it work? Commented Dec 22, 2011 at 21:50
  • <a href="javascript:void(0)" onclick="editInfo(&quot;xxx_c_1_f_983&quot; ,false)">Add This (+4 Shares, +300 Tickets)</a> Commented Dec 22, 2011 at 21:53
  • @S.Lott yes, it is using onclick i guess Commented Dec 22, 2011 at 21:54
  • Please update the question with all the facts. Do not add comments to the question. Please update the question and then delete the comments. Commented Dec 22, 2011 at 21:55

1 Answer 1

1

I think probably the best way to do this is to use a framework that can operate through a browser. There are several options, but the most pythonic is windmill http://www.getwindmill.com/

I've found it useful on a number of projects.

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

Comments

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.