2

I am new to Python coding and i am trying to open a web page using python. I used web browser.open to open the web page. After i opened the web page i want to click a tab called "Submit" on the web page when the timer on the page reaches zero. If i get a error then it should return to the original page without any user interaction. Is this possible?

Thanks

buggsbunny4
  • 115
  • 2
  • 12

3 Answers3

3

Instead of using that particular module, maybe you want to use Selenium RC, which has python bindings.

SingleNegationElimination
  • 151,563
  • 33
  • 264
  • 304
2

This will depend on if you need to use a "real" browser application to do this. Can you explain what you are trying to do in a bit more detail?

Anyway...

If you need a "real" browser to launch and make these requests, then the Selenium RC package is what you need.

On the other hand, if it's OK that Python does all the page loading internally, then the popular Mechanize module should do the trick.

To Explain:

If you are depending on a complex JavaScript powered page, then you must use Selenium. If it's just HTML stuff, then Mechanize can emulate it all inside python.

Hope this helps. If so, mark this answered and let me know. :-)

nonot1
  • 2,788
  • 4
  • 25
  • 41
  • I would like to use real browser as I need to input other details after the programs hits "submit" button. I think it is a complex java script page. I am trying to automate a bidding page using python. – buggsbunny4 Nov 23 '10 at 03:22
  • Yep, so you will need Selenium. It does support Python. If you dont like Selenium, you can try Greasemonkey for Firefox. (But that is Javascript.) If my answer helps, please mark as answered. Thanks. :-) – nonot1 Nov 23 '10 at 03:26
1

This is what mechanize is for: http://wwwsearch.sourceforge.net/mechanize/

robert
  • 33,242
  • 8
  • 53
  • 74