Не работаетДальше переходишь на "мой адрес" и там делаешь вставить и enter. Более подробное описание в сообщении скрипта
---------Двойное сообщение соединено: ---------
Не работаетДальше переходишь на "мой адрес" и там делаешь вставить и enter. Более подробное описание в сообщении скрипта
Поле ввода и кнопка появились. Что не работает?Не работает
Не получится, потому что поля логина и пароля находятся во фрейме, а фрейм идет с другого домена. Т.е. страница с aliexpress.ru, а фрейм с aliexpress.comВ скрипт логина, добавить чтоб работало на этой странице тоже (в определенных случаях бывает полезно через такую страницу входить):
А дальше пишет "Неправильный формат", я может не особо понимаю, что там делать нужно?Поле ввода и кнопка появились. Что не работает?
Не получится, потому что поля логина и пароля находятся во фрейме, а фрейм идет с другого домена. Т.е. страница с aliexpress.ru, а фрейм с aliexpress.com
телефон:адрес:имя
телефон\tадрес\tимя
Доделал скрипт, теперь все данные можно брать со строкиА можно сделать, чтобы индекс, или даже все данные кроме страны брались с EXCEL. У меня несколько адресов доставки и всегда стараюсь все данные менять. Для РФ не столь актуально, там город и провинция идет в выпадающем списке, а для РБ идёт просто прописью, и хотелось бы все менять. Да и индекс думаю многие меняют и неудобно все время менять его в самом скрипте. А так скопировал всю строку со всеми параметрами с EXCEL и нет проблем. Можно просто доп. строчки в теме прописать, что вставить, что убрать.
let myIndex = "100000";
let myPhoneCode = "+7";
let myCountry = "KZ";
let myProvince = ""; // - берем из строки
let myCity = ""; // - берем из строки
let orderPhone = 0;
let orderAddr = 1;
let orderName = 2;
let orderCity = 3; // - берем из строки
let orderProvince = 4; // - берем из строки
подскажи , а можно сделать чтобы вытягивало какой цвет заказан. Например в лоте 10 разных цветов все они пронумерованы у прода допустим А,В,С,D,H. И что бы потом в информации допустим вместо картинки показывало цвет A .Ну вот здесь же все расписано с картинками.
---------Двойное сообщение соединено: ---------Код:// ==UserScript== // @name Aliexpress Order info getter track // @namespace http://tampermonkey.net/ // @version 1.0 // @description Получение информации из заказа и трека // @author Andronio // @match https://trade.aliexpress.ru/orderList.htm* // @match https://trade.aliexpress.ru/order_list.htm* // @match https://trade.aliexpress.com/orderList.htm* // @match https://trade.aliexpress.com/order_list.htm* // @noframes // ==/UserScript== /* prodName - Название товара picURL - URL-ссылка на картинку-превью товара prodPrice - Цена товара today - Сегодняшняя дата orderNum - Номер заказа \t - Табуляция, переход к следующей ячейке picPrefix - 1 - добавлять префик picURL= для адреса картинки, 0 - не добавлять track - Трек-номер заказа date - Дата автозакрытия заказа Строка должна начинаться и заканчиваться символом обратной кавычки */ var orderStr = `prodName + '\t' + picURL + '\t' + prodPrice + '\t' + today + '\t' + orderNum`; var trackStr = `track + '\t' + date`; let picPrefix = 1; /* Далее не трогать */ let ordersMass = []; let trackMass = []; (function () { 'use strict'; // Рисуем окно с кнопками var div = document.createElement('div'); div.className = 'mybox'; let product = document.querySelectorAll('.order-item-wraper'); let hasTrackable = false; if (product.length == 0) { div.innerHTML = '<p class="noorders">Нет заказов</p>'; } else { let str = document.body.innerHTML.split("var appealInfoParams = encodeURIComponent('")[1].split("');")[0]; if (str.match(/\[(\{("\w+":["\w]+,)+"\w+":["\w]+\},){0,30}\{("\w+":["\w]+,)+"\w+":["\w]+\}\]/g)) { ordersMass = eval(str); ordersMass.forEach(order => { if (order.orderStatus == "WAIT_BUYER_ACCEPT_GOODS") { hasTrackable = true; } }); } div.innerHTML = `<button class="infoGetter" myattr="-1">Все заказы</button>`; if (hasTrackable) div.innerHTML +=`<button class="trackGetter" myattr="99" disabled>Треки</button>`; for (let i = 0; i < product.length; i++) { let productName = product[i].querySelectorAll(".product-title > a.baobei-name")[0].getAttribute("title").substr(0,20); div.innerHTML += `<br><button class="infoGetter" myattr="${i}">${i+1} - <span style="color:green">${productName}</span></button>`; if (hasTrackable && ordersMass[i].orderStatus == 'WAIT_BUYER_ACCEPT_GOODS') div.innerHTML += `<button class="trackGetter" myattr="${i+100}" disabled>Трек</button>`; } } document.body.append(div); var styles = ` .mybox { position: fixed; top: 0; right: 0; background: white; box-shadow: 1px -1px 4px 1px; max-width: 40%; max-height: 400px; padding: 10px 10px; overflow-y: auto; overflow-x: hidden; z-index:9999; } .noorders { color: red; text-align: center; font-size: 1.5em; padding: 5px; margin: 0; } .infoGetter { display: inline; margin-right:auto; margin-top: 2px; cursor:pointer; padding: 5px; width: 180px; text-align: left; } .trackGetter { display: inline; margin-right:auto; margin-top: 2px; cursor:pointer; padding: 5px; width: 46px; text-align: left; } .greenbutton{ background-color: LightGreen; }` var styleSheet = document.createElement("style") styleSheet.type = "text/css" styleSheet.innerText = styles document.head.append(styleSheet) div.addEventListener('click', buttonClick); if (hasTrackable) getTracks(); })(); function buttonClick(event) { let elem = event.target; if (elem.tagName != "BUTTON") { elem = elem.parentNode; if (elem.tagName != "BUTTON") return; } let orderString; let num = +elem.getAttribute('myattr'); if (num > 98) return trackBuff(num, elem); else { let product = document.querySelectorAll('.order-item-wraper'); let productPrice = document.querySelectorAll(".amount-num"); let orderNumber = document.querySelectorAll(".order-info > .first-row > span.info-body"); let today = formatDate(); let prodName, prodPrice, orderNum; if (num > -1) { // один заказ let productName = product[num].querySelectorAll(".product-title > a.baobei-name"); let picURL = product[num].querySelectorAll(".pic.s50 > img")[0].src; if (picPrefix) picURL = "picURL=" + picURL; prodName = `=ГИПЕРССЫЛКА("https:\/\/www.aliexpress.ru\/item\/${productName[0].getAttribute("productid")}.html";` + `"${productName[0].getAttribute("title").substr(0,80)}")`; prodPrice = productPrice[num].innerText.match(/\d+\.\d+/); if (prodPrice) prodPrice = prodPrice[0].replace(/\./,","); else prodPrice = productPrice[num].innerText.trim(); orderNum = orderNumber[num].innerText; orderString = eval(orderStr); } else { // много заказов orderString = ""; for (let num = 0; num < orderNumber.length; num++) { let productName = product[num].querySelectorAll(".product-title > a.baobei-name"); let picURL = product[num].querySelectorAll(".pic.s50 > img")[0].src; if (picPrefix) picURL = "picURL=" + picURL; prodName = `=ГИПЕРССЫЛКА("https:\/\/www.aliexpress.ru\/item\/${productName[0].getAttribute("productid")}.html";` + `"${productName[0].getAttribute("title").substr(0,80)}")`; prodPrice = productPrice[num].innerText.match(/\d+\.\d+/); if (prodPrice) prodPrice = prodPrice[0].replace(/\./,","); else prodPrice = productPrice[num].innerText.trim(); orderNum = orderNumber[num].innerText; orderString += eval(orderStr); orderString += "\r\n"; } } } navigator.clipboard.writeText(orderString).then(function () { console.log('Async: Copying to clipboard was successful!'); window.mybtn = elem; window.mybtn.classList.add("greenbutton"); setTimeout(() => window.mybtn.classList.remove("greenbutton"), 500); }, function (err) { console.error('Async: Could not copy text: ', err); }); } function trackBuff(num, elem){ num -= 100; let date, track, orderString = ""; let trackMassCopy = trackMass.slice(); if (num > -1) { let el = trackMassCopy.find(index => index.id == ordersMass[num].id); date = el.date; track = el.track; orderString = eval(trackStr); } else { for (let i = 0; i < ordersMass.length; i++) { if (ordersMass[i].orderStatus == "WAIT_BUYER_ACCEPT_GOODS") { let el = trackMassCopy.shift(); date = el.date; track = el.track; orderString += eval(trackStr); } orderString += "\r\n"; } } navigator.clipboard.writeText(orderString).then(function () { console.log('Async: Copying to clipboard was successful!'); window.mybtn = elem; window.mybtn.classList.add("greenbutton"); setTimeout(() => window.mybtn.classList.remove("greenbutton"), 500); }, function (err) { console.error('Async: Could not copy text: ', err); }); } function getTracks() { ordersMass.forEach(order => { if (order.orderStatus == "WAIT_BUYER_ACCEPT_GOODS") { trackMass.push({id: order.id, track: "", date: ""}); } }); let requests = trackMass.map(order => fetch(`${location.protocol}//${location.hostname}/order_detail.htm?orderId=${order.id}`)); Promise.all(requests) .then(responses => Promise.all(responses.map(r => r.text()))) .then(texts => { for (let i = 0; i < texts.length; i++) { let obj = document.createElement('html'); obj.innerHTML = texts[i]; let track = obj.querySelector(".flush-btn").getAttribute("logisticsNo"); let date = obj.querySelector('.order-reminder'); if (!track || !date) return alert("Не получил информацию о заказе"); date = date.innerText.match(/\d{4}-\d\d-\d\d/g); if (date.length > 0) date = date[0].replace(/\d\d(\d\d)-(\d\d)-(\d\d)/, '$3.$2.$1'); else return alert("Не правильная дата в заказе"); trackMass[i].track = track; trackMass[i].date = date; } document.querySelectorAll(".trackGetter").forEach(elem => elem.removeAttribute("disabled")); }) .catch(err => alert(`Ошибка ${err}`)); } function formatDate() { let date = new Date(); let dd = date.getDate(); if (dd < 10) dd = '0' + dd; let mm = date.getMonth() + 1; if (mm < 10) mm = '0' + mm; let yy = date.getFullYear() % 100; if (yy < 10) yy = '0' + yy; return dd + '.' + mm + '.' + yy; }
а можно еще на скидка.ру сделать?Скрипт авторизации на cash4brands
Код:// ==UserScript== // @name Cash4Brands login // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author Andronio // @match https://cash4brands.ru/ // @match https://cash4brands.ru/cashback/aliexpress/ // @match https://cash4brands.ru/gotoshop/25/ // @grant none // ==/UserScript== let loginEmail = "login@ligin.com"; let loginPassw = "Password"; (function repeat() { 'use strict'; if (location.href == "https://cash4brands.ru/") { let avatar = document.querySelector(".avatar"); let register = document.querySelectorAll(".login-wrap__reg-link"); if (!avatar && !register.length) setTimeout(repeat, 100); if (register.length) { let step = localStorage.getItem("step"); if (!step || step == "0") { localStorage.setItem("step", "1"); document.querySelector(".login-wrap__login-link").click(); return setTimeout(repeat, 200); } if (step == "1") { localStorage.setItem("step", "2"); document.querySelectorAll('[data-form="email_enter"]')[1].click(); return setTimeout(repeat, 200); } if (step == "2") { localStorage.setItem("step", "0"); document.querySelectorAll('input[name="email"]')[3].value = loginEmail; document.querySelectorAll('input[name="pass"]')[2].value = loginPassw; document.querySelectorAll('.btn_group input')[0].click(); } } if (avatar) { location.href = "https://cash4brands.ru/gotoshop/25/"; return; } } if (location.href == "https://cash4brands.ru/cashback/aliexpress/") { document.querySelector('.goshop_btn_wrap .button.tooltip').click(); } if (location.href == "https://cash4brands.ru/gotoshop/25/") { document.querySelector('.button').click(); } })();
---------Двойное сообщение соединено: ---------Скрипт авторизации на bonus.webmoney.ru
Код:// ==UserScript== // @name Bonus WM login // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author Andronio // @match https://bonus.webmoney.ru/ // @match https://login.wmtransfer.com/GateKeeper/Password/* // @match https://bonus.webmoney.ru/shop/aliexpress-com/* // @grant none // ==/UserScript== let wmID = "000000000000"; let wmPass = "000000000"; (function repeat() { 'use strict'; if (location.href.startsWith("https://bonus.webmoney.ru/shop/aliexpress-com/")) { let gotoBtn = document.querySelector('.goToShopLink'); if (!gotoBtn) return setTimeout(repeat, 200); location.href = gotoBtn.href; } if (location.href == "https://bonus.webmoney.ru/") { let loginBnt = document.querySelector('.login'); let avatarBnt = document.getElementById("avatar"); if (!loginBnt && !avatarBnt) return setTimeout(repeat, 200); if (loginBnt) loginBnt.click(); if (avatarBnt) { let shops = document.querySelectorAll('.shopItem'); if (shops.length == 0) return setTimeout(repeat, 200); shops.forEach(elem => { if (elem.getAttribute("title").includes("AliExpress")) { elem.querySelector(".shopMoreInfoBtn").click(); } }); return setTimeout(repeat, 200); } } if (location.href.startsWith("https://login.wmtransfer.com/GateKeeper/Password/")) { document.getElementById("Login").value = wmID; document.getElementById("Password").value = wmPass; document.querySelector("#Captcha").focus(); } })();
Для скидки существует "вечная ссылка" и скрипт такой уже есть.а можно еще на скидка.ру сделать?
спасибо.все получилосьДля скидки существует "вечная ссылка" и скрипт такой уже есть.
Вот, нашел в закладках:
https://mipped.com/f/threads/obsuzhdenija-kuponov-aliexpress-oktjabr.83079/page-1575#post-1919553
https://mipped.com/f/threads/obsuzhdenija-kuponov-aliexpress-oktjabr.83079/page-1786#post-1935334
ссылки умерли, не открываются какие-либо инструкции....спасибо.все получилось
Сделал через кликер.Предложу идею сделать скрипт для поиска добивки с примерным алгоритмом его работы.
Накидал по быстрому такой скрипт, товары только не прячет, вроде работает:Предложу идею сделать скрипт для поиска добивки с примерным алгоритмом его работы.
1. Скрипт срабатывает на https://aliexpress.ru/wholesale
2. Скрипт добавляет окно для ввода суммы и кнопку ок.
3. При вводе в окно, например значения 013, он видит первый 0 и добавляет в оба окна числа 0.13
3.1 При вводе в окно, например значения 133, он видит, что первый НЕ 0 и добавляет в оба окна числа 1.33
3.2 При вводе в окно любого числа с точкой, он добавляет в оба окна то, что ввели без изменений.
4. При нажатии интер или ОК выставляет бесплатную доставку и запускает поиск.
5... В идеале, что бы после поиска скрипт прятал все товары, где стоимость может быть выше нужной. К примеру на картинке отображен товар, где по сути нет стоимости в 0,13... И придётся пролестать пару страниц в поисках товара только за 0,13
// ==UserScript==
// @name SS
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://*.aliexpress.com/wholesale*
// @match *://*.aliexpress.ru/wholesale*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var first_trigger=true;
// console.log('START');
window.onload = function(){
if(first_trigger){
/*
localStorage.setItem("second", "true");
var setting = localStorage.getItem("second");
console.log(setting);
*/
document.getElementsByClassName('nav-breadcrumb')[0].insertAdjacentHTML('afterend',`<div style="position:relative;border-radius:3px;text-align:center; top:5px;padding-top:5px;padding-bottom:5px;width:112px;background:#ef0000;color:white">Дополнить
<div id="s_inp_cost" style="position:absolute;border-radius:3px;display: inline-block;border:none;background:blue;top:0px;height:100%; left:117px;">
<input id="avg_id" value="" style="line-height:1.51em;width:4.5em;" placeholder="avg" autocomplete="off" value="" >
</div>
<div id="vai" style="position:absolute;background:orange;user-select:none;cursor:pointer;left:14em;width:60px;text-align:center; top:0px;border-radius:3px;padding-top:5px;padding-bottom:5px;">OK</div>
</div>
`);
document.getElementById('vai').addEventListener('click',comecar);
function comecar(event){
var preco = document.getElementById('avg_id').value.toString();
var tipo = -1;
var tem_un_ponto = preco.indexOf('.');
if(tem_un_ponto>-1){ tipo = 1; }
else{
var o_primeiro = preco.substring(0,1);
if(o_primeiro === '0'){ tipo = 2; }else{
tipo = 3;
}
}//else nao ponto
// console.log(tipo);
var min_set = document.querySelector("input[placeholder='min']");
var max_set = document.querySelector("input[placeholder='max']");
if(!min_set){
min_set = document.querySelector("input[placeholder='мин']");
max_set = document.querySelector("input[placeholder='макс']");
}
var nivs = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set;
min_set.focus();
switch(tipo){
case 1:
// min_set.value = preco;
// max_set.value = preco;
nivs.call(min_set, preco);
min_set.dispatchEvent(new Event('change', {bubbles: true}));
nivs.call(max_set, preco);
max_set.dispatchEvent(new Event('change', {bubbles: true}));
;break;
case 2:
// min_set.value = o_primeiro +'.'+preco.substring(1);
// max_set.value = o_primeiro +'.'+preco.substring(1);
nivs.call(min_set, o_primeiro +'.'+preco.substring(1));
min_set.dispatchEvent(new Event('change', {bubbles: true}));
nivs.call(max_set, o_primeiro +'.'+preco.substring(1));
max_set.dispatchEvent(new Event('change', {bubbles: true}));
break;
case 3:
// min_set.value = o_primeiro +'.'+preco.substring(1);
// max_set.value = o_primeiro +'.'+preco.substring(1);
nivs.call(min_set, o_primeiro +'.'+preco.substring(1));
min_set.dispatchEvent(new Event('change', {bubbles: true}));
nivs.call(max_set, o_primeiro +'.'+preco.substring(1));
max_set.dispatchEvent(new Event('change', {bubbles: true}));
;break;
}
//click price
var gogo = document.querySelector('a.ui-button.narrow-go');
if(gogo){gogo.click();
}
var target = document.getElementsByClassName('list-items')[0];
const config = {
attributes: true,
childList: true,
subtree: true
};
// Функция обратного вызова при срабатывании мутации
const callback = function(mutationsList, observer) {
for (let mutation of mutationsList) {
if (mutation.type === 'childList') {
//free ship click
var envio_gratis = document.querySelectorAll("span span.next-checkbox-label span");
for (var ips = 0; ips < envio_gratis.length; ips++) {
if (envio_gratis[ips].textContent == "Free Shipping" || envio_gratis[ips].textContent == "Бесплатная Доставка") {
envio_gratis = envio_gratis[ips];
break;
}
}
if(envio_gratis.parentElement.parentElement.getElementsByClassName('next-checkbox')[0].getElementsByTagName('input')[0]){
if(!envio_gratis.parentElement.parentElement.getElementsByClassName('next-checkbox')[0].getElementsByTagName('input')[0].checked){
envio_gratis.click();
// envio_gratis.parentElement.parentElement.getElementsByClassName('next-checkbox')[0].getElementsByTagName('input')[0].checked==='true';
} }
observer.disconnect();
}
}
};//callback
const observer = new MutationObserver(callback);
observer.observe(target, config);
}//comecar
first_trigger=false;
}//!first_trigger
}
})();
Можно как-то переделать, чтобы менял только страну доставки а валюта всегда оставалась $ ?Скрипт работает на всех страницах алиэкпресса, воткнуть кнопку на каждую страницу невозможно, а делать плавающую - не эргономично, и так уже всяких кнопок на каждой странице.
Это надо проводить исследования, на которые у меня нет времени.
Скрипт автоматически меняет страну доставки на выбранную и валюту. Исправленная версия, не должен конфликтовать со скриптом мипеда. Можно выбирать что менять, если параметр оставить пустым, то он меняться не будет, вот так:
Код:let myCurrency = ""; let myCountry = "";
Код:// ==UserScript== // @name Aliexpress Country Changer // @namespace http://tampermonkey.net/ // @version 0.2 // @description Изменяет страну и валюту // @author Andronio // @match https://*.aliexpress.ru/* // @match https://*.aliexpress.com/* // @grant none // @run-at document-start // ==/UserScript== let myCurrency = "USD"; let myCountry = "KZ"; (function () { 'use strict'; if (!location.href.includes("mydata=123")) { let cookies = document.cookie.split('; '); let isNeedModif = false; let str; for (let i = 0; i < cookies.length; i++) { if (cookies[i].startsWith("aep_usuc_f=")) { // Если нашел нужную куку let cookie = cookies[i].slice(11).split('&'); // Убираем aep_usuc_f= cookie = cookie.map(elem => { // Смотрим, что в куке if (elem.startsWith("c_tp=")) { if (myCurrency != "" && elem.slice(5) != myCurrency) { isNeedModif= true; return "c_tp=" + myCurrency; } else return elem; } if (elem.startsWith("region=")) { if (myCountry != "" && elem.slice(7) != myCountry) { isNeedModif= true; return "region=" + myCountry; } else return elem; } return elem; }); str = cookie.join("&"); } }; if (isNeedModif) { if (location.hostname.includes("aliexpress.ru")) { document.cookie = `aep_usuc_f=${str}; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT; domain=.aliexpress.ru`; } else if (location.hostname.includes("aliexpress.com")) { document.cookie = `aep_usuc_f=${str}; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT; domain=.aliexpress.com`; } else {alert("Ошибка в скрипте")}; location.reload(); } } })();
Можно как-то переделать, чтобы менял только страну доставки а валюта всегда оставалась $ ?
Тык автор сам оставил пояснение!Можно выбирать что менять, если параметр оставить пустым, то он меняться не будет, вот так:
// ==UserScript==
// @name Aliexpress Country Changer
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Изменяет страну и валюту
// @author Andronio
// @match https://*.aliexpress.ru/*
// @match https://*.aliexpress.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
let myCountry = "KZ";
(function () {
'use strict';
if (!location.href.includes("mydata=123")) {
let cookies = document.cookie.split('; ');
let isNeedModif = false;
let str;
for (let i = 0; i < cookies.length; i++) {
if (cookies[i].startsWith("aep_usuc_f=")) { // Если нашел нужную куку
let cookie = cookies[i].slice(11).split('&'); // Убираем aep_usuc_f=
cookie = cookie.map(elem => { // Смотрим, что в куке
if (elem.startsWith("region=")) {
if (myCountry != "" && elem.slice(7) != myCountry) {
isNeedModif= true;
return "region=" + myCountry;
} else return elem;
}
return elem;
});
str = cookie.join("&");
}
};
if (isNeedModif) {
if (location.hostname.includes("aliexpress.ru")) {
document.cookie = `aep_usuc_f=${str}; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT; domain=.aliexpress.ru`;
} else if (location.hostname.includes("aliexpress.com")) {
document.cookie = `aep_usuc_f=${str}; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT; domain=.aliexpress.com`;
} else {alert("Ошибка в скрипте")};
location.reload();
}
}
})();