Skip to content

Instantly share code, notes, and snippets.

@nor24o
Last active December 3, 2024 05:08
Show Gist options
  • Save nor24o/802f7c34afaead8dc61417b1cb35a46d to your computer and use it in GitHub Desktop.
Save nor24o/802f7c34afaead8dc61417b1cb35a46d to your computer and use it in GitHub Desktop.
A script to extract Tracking id from Aliexpress order list
//to use this js go to order list the open developer mote and paste the following code in the console:
//VARIANT 1 just tdisplay
var elems = Array.prototype.slice.call(document.querySelectorAll('.order-item'));
elems.forEach(function(elem) {
var status = elem.querySelector('.order-item-header-status-text');
var orderInfo = elem.querySelector('.order-item-header-right-info');
if (status && status.textContent === 'Awaiting delivery' && orderInfo) {
var orderIdText = orderInfo.textContent;
var orderId = orderIdText.match(/Order ID: (\d+)/);
if (orderId) {
console.log("Tracking ID:", orderId[1]);
}
}
});
//VARIANT 2 track in 17Track
var elems = Array.prototype.slice.call(document.querySelectorAll('.order-item'));
var trackingIDs = [];
elems.forEach(function(elem) {
var status = elem.querySelector('.order-item-header-status-text');
var orderInfo = elem.querySelector('.order-item-header-right-info');
if (status && status.textContent === 'Awaiting delivery' && orderInfo) {
var orderIdText = orderInfo.textContent;
var orderId = orderIdText.match(/Order ID: (\d+)/);
if (orderId) {
trackingIDs.push(orderId[1]);
}
}
});
var trackingIDsString = trackingIDs.join(',');
var trackingURL = "https://t.17track.net/en#nums=" + trackingIDsString;
// Call the URL
window.location.href = trackingURL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment