Execute javascript code on website

qlwik

Client
Регистрация
03.04.2013
Сообщения
207
Благодарностей
5
Баллы
18
Hi,
I want to execute javascript code on https://example.com website, I know I can simply enter this website in ZP web browser, but I want to run in on many websites and I need it to be fast, so question is:
Can I run javascript code on custom website with javascript or C block in ZP?
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
112
Баллы
43
Yes you can.
 

qlwik

Client
Регистрация
03.04.2013
Сообщения
207
Благодарностей
5
Баллы
18

qlwik

Client
Регистрация
03.04.2013
Сообщения
207
Благодарностей
5
Баллы
18
So nobody on entire forum doesn't know how to do it?
 

aleksa77

Client
Регистрация
30.09.2011
Сообщения
914
Благодарностей
90
Баллы
28
you have action step called "javascript" and there you can add javascript functions, for example, this my code take number of characters from variable uvodjava and back me number



and you can see on top, you can change locally to current page, and make action connected with current page in browser.
 

qlwik

Client
Регистрация
03.04.2013
Сообщения
207
Благодарностей
5
Баллы
18
Thank You for tip, I know about it, as mentioned on first topic, I don't want to load website in to browser, because it is too slow and I will use it on many websites.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
So nobody on entire forum doesn't know how to do it?
Hi, your question is really not easy answerable.
First of all You do not load webpages with javascript. You can look in GET/POST request way for that.
Second of all you need page-load or at least some data to input in javascript functions. Sometimes it is very complex to find what exactly you need.
You need pretty good programming knowledge to work from there in general, it is not like simple one-sentence answer, that's why there is not much answers :-)
 

qlwik

Client
Регистрация
03.04.2013
Сообщения
207
Благодарностей
5
Баллы
18
Thank You for answer, I know I have to load website first and I want to do it with get, then I search javascript code with regex, how can I execute that code on that website?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Thank You for answer, I know I have to load website first and I want to do it with get, then I search javascript code with regex, how can I execute that code on that website?
Javascript can do many different things mate.
You look what javascript does and You replicate that.
So for example, if javascript sends some requests then You have to make same request with your own GET/POST, if javascript does something other You have to replicate that as well, it all depends.
 

qlwik

Client
Регистрация
03.04.2013
Сообщения
207
Благодарностей
5
Баллы
18
Okay lets say I want to execute analitics code, how can I do that?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113

qlwik

Client
Регистрация
03.04.2013
Сообщения
207
Благодарностей
5
Баллы
18
Google analytics is statisctisc for websites, it show any pagewievs on website, I want to simulate that pageview, its code looks like this:
JavaScript:
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
            })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
            ga('create', 'UA-152788937-1', 'auto');
            ga('send', 'pageview');
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)