text using python? ...">

How to simulate clicks on <a href= "https://stackoverflow.com/javascript:dosomething(12345)" rel="nofollow noreferrer"> text </a> using python?

I want to simulate such clicks without controlling web browsers in order to get the job done. I don't know much about javascript and really don't know where to start. Any ideas?

+3
source share
4 answers

You can use iMacros in combination with Python ...

This is not a straightforward solution, since for this you need to write an iMacros script to actually click, and then load the page and call the script from Python.

Refereces:

+1

Althoug , , , , - , :

:

+1

(, ID), javascript

var link = document.getElementById['yourLinksIdAttrbuteValue'];
link.click();

jQuery , ...

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script>
     $(function(){ $("a[href^='javascript']:contains('text')").click() });
</script>

JQuery google, dom .

jQuery http://api.jquery.com/category/selectors/

0
0

Source: https://habr.com/ru/post/1756552/


All Articles