0

I'm looking for a way to click buttons and follow links in pyhton. Or essentially run the javascript function in this tag. I'm trying to use robobrowser but its not working.

 <a id="h_w_PC_ctl07_lnkCheckCoupon" class="btnCheckCoupon" title="Check" href="javascript:__doPostBack('h$w$PC$ctl07$lnkCheckCoupon','')"></a>

Thats the html from the site.

  • 1
    Selenium is probably the easiest. – Pythonista Jun 09 '17 at 21:18
  • For simple graphical interface such as buttons you can use the tkinter module that is always installed with python (warning: depending on the version of python the spelling may be with a 'T' instead of the 't'). the 'ttk' submodule is also interesting. – Stéphane Jun 10 '17 at 05:50
  • I suggest Twill for Python. Pretty simple and useful library. http://twill.idyll.org/python-api.html docs are pretty shallow but google for more tutorials. – John Morrison Jun 14 '17 at 17:47
  • This might help https://stackoverflow.com/questions/15341285/how-to-call-a-django-function-on-button-click – NIMIT AGRAWAL Apr 03 '19 at 17:19
  • This might help https://stackoverflow.com/questions/15341285/how-to-call-a-django-function-on-button-click – NIMIT AGRAWAL Apr 03 '19 at 17:21

1 Answers1

1

Selenium will allow you to interact with websites using python and perform actions such as clicking a button.

To install selenium use the following command:

pip install selenium (this is assuming you have pip installed)

After selenium is installed you must download a web driver. If you plan to automate a google chrome web browser the link for the download can be found here http://chromedriver.chromium.org/

pete lee
  • 95
  • 1
  • 10