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.

5
  • 1
    Selenium is probably the easiest. Commented Jun 9, 2017 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. Commented Jun 10, 2017 at 5:50
  • I suggest Twill for Python. Pretty simple and useful library. twill.idyll.org/python-api.html docs are pretty shallow but google for more tutorials. Commented Jun 14, 2017 at 17:47
  • This might help stackoverflow.com/questions/15341285/… Commented Apr 3, 2019 at 17:19
  • This might help stackoverflow.com/questions/15341285/… Commented Apr 3, 2019 at 17:21

1 Answer 1

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/

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.