1

My python program basically submits a form by loading a URL. There is a security code that seems to change every second so that you have to actually be on the website to enter the form.

For example,

http://www.locationary.com/prizes/index.jsp?ACTION_TOKEN=index_jsp$JspView$BetAction&inTickets=125000000&inSecureCode=091823021&inCampaignId=3060745 

The only solution I can think of is using something like Selenium...I don't know any other way of kind of simulating a web browser but not really having it be as heavy and slow as a web browser...any ideas? Or is there a way I can do this without browser automation?

EDIT:

Response to first answer: I DID get the security code using urllib...the problem is that it seems to already have changed by the time I try to load my submission url...so I'm just guessing/assuming that you have to do it in realtime...

2
  • 1
    What do you mean by "realtime"? When you run your python program, it is being executed in real time. Selenium and mechanize at their core are doing the same thing you tried to do with urllib - there's nothing that makes them "realtime" and urllib "faketime". Commented Aug 17, 2012 at 20:54
  • @MarcusJohnson: You might want to contact the people that run that website, as there may be another way to get a security code. Alternatively, if they really don't want you to submit the form, there may be legal reasons why it would be better to take an alternative approach anyway. Commented Aug 17, 2012 at 21:05

1 Answer 1

1

Yes, you'll need to get the security code programmatically since it changes every time. You can do this manually with urllib, or you can use mechanize or Selenium to make things easier.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.