Last active
April 2, 2021 12:34
-
-
Save leotop/90866f21deff4d008b0c2e6061a0644b to your computer and use it in GitHub Desktop.
Получить номера отправлений в ЛК ОЗОН
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tdlist = document.getElementsByClassName("_no-leftShadow")[0].firstChild.getElementsByTagName("tr"); | |
tdlist.forEach(function(item, i, tdlist) { | |
otpravlenie = item.getElementsByTagName("td")[2]; | |
if (typeof otpravlenie !== 'undefined') { | |
console.log(otpravlenie.innerText); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parseSku() { | |
document.getElementById("parsetxt").innerHTML=""; | |
document.getElementById("producttxt").innerHTML=""; | |
var skutxt = document.getElementById("parsetxt"); | |
var producttxt=document.getElementById("producttxt"); | |
tdlist = document.getElementsByClassName("_no-leftShadow")[0].firstChild.getElementsByTagName("tr"); | |
tdlist.forEach(function(item, i, tdlist) { | |
otpravlenie = item.getElementsByTagName("td")[2]; | |
if (typeof otpravlenie !== 'undefined') { | |
//console.log(otpravlenie.innerText); | |
skutxt.innerHTML += otpravlenie.innerText + "<br>"; | |
//producttxt.innerHTML += otpravlenie.firstChild.getElementsByTagName("div")[2].innerText + "<br>" | |
} | |
otpravlenieName = item.getElementsByTagName("td")[4]; | |
if (typeof otpravlenieName !== 'undefined') { | |
//console.log(otpravlenieName.innerText); | |
producttxt.innerHTML += otpravlenieName.firstChild.getElementsByTagName("div")[2].innerText + "<br>"; | |
// producttxt.innerHTML += otpravlenie.firstChild.getElementsByTagName("div")[2].innerText + "<br>" | |
} | |
}); | |
return ""; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Hello World | |
// @namespace ozon.ru | |
// @version 0.01 | |
// @description Этот скрипт покажет вам алерт с "hello word" на каждой странице, кроме исключений! | |
// @include https://seller.ozon.ru/postings/fbs?deliveryMethodId=* | |
// @exclude https://ozon.ru.ru/* | |
// ==/UserScript== | |
//alert('Hello world!'); | |
var parsebtn = document.createElement("div"); | |
parsebtn.innerHTML = '<div><button onclick="parseSku()">Артикулы</button></div><div id="parsetxt"></div><div id="producttxt"></div>'; | |
document.body.insertBefore(parsebtn, document.body.firstChild); | |
var parsejs = document.createElement('script'); | |
parsejs.setAttribute("type", 'text/javascript'); | |
parsejs.innerHTML ='function parseSku(){document.getElementById("parsetxt").innerHTML="",document.getElementById("producttxt").innerHTML="";var e=document.getElementById("parsetxt"),t=document.getElementById("producttxt");return tdlist=document.getElementsByClassName("_no-leftShadow")[0].firstChild.getElementsByTagName("tr"),tdlist.forEach(function(n,r,a){otpravlenie=n.getElementsByTagName("td")[2],"undefined"!=typeof otpravlenie&&(e.innerHTML+=otpravlenie.innerText+"<br>"),otpravlenieName=n.getElementsByTagName("td")[4],"undefined"!=typeof otpravlenieName&&(t.innerHTML+=otpravlenieName.firstChild.getElementsByTagName("div")[2].innerText+"<br>")}),""}'; | |
document.body.insertBefore(parsejs, document.body.firstChild); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment