Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Authentication
- "use strict";
- var siteUrl = 'http://www.3dcontentcentral.com/secure/download-model.aspx? catalogid=10260&id=496588';
- var page = require('webpage').create();
- page.open(siteUrl, function (status) {
- if (status !== 'success') {
- console.log('Unable to access network');
- } else {
- console.log("Status: " + status);
- page.render('yes.png');
- var fs = require('fs');
- fs.write('page.html', page.content, 'w');
- //заполняем
- page.evaluate(function() {
- document.getElementById("3dcclogin").value = "mymail@mail.ru";
- document.getElementById("3dccpassword").value = "mypass";
- document.getElementById("btn_ucLogin").click();
- });
- }
- page.render('yes2.png');
- fs.write('page1.html', page.content, 'w');
- phantom.exit();
- });
- ///////всё работает без лишних слов//////////
- var page = require ('webpage').create();
- var system = require("system");
- page.open("адрес сайта", function(status){
- console.log('открыто');
- page.settings.resourceTimeout = 1000;
- page.onLoadFinished = function(status) {
- setTimeout(function() {
- page.render("ollgod.png");
- console.log('see ollgod.png');
- phantom.exit();
- }, 10000)
- };
- page.includeJs('http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', function(){
- page.evaluate(function (){
- $("#ид или .класс").val("логин");
- $("#ид или .класс").val("пароль");
- $("#ид или .класс").click();
- });
- console.log('login good');
- page.render("before_submit.png");
- console.log('see login.png ');
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement