Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function push_items(count, string) {
- var data = JSON.parse(string)
- parse_x_items(count, data)
- return JSON.stringify(data)
- }
- function parse_x_items(count, data) {
- var pages = Math.ceil(count/50)
- for (var i = 0; i<pages; i++){
- parse_items(data)
- document.querySelector("#lv-items > div.listview-band-top > div.listview-nav > a:nth-child(5)").click()
- }
- return data
- }
- function parse_items(items) {
- var trs = document.querySelectorAll("#lv-items > div.listview-scroller-horizontal > div > table > tbody > tr")
- trs.forEach(tr => items.push(parse_row(tr)))
- return items
- }
- function parse_row(row) {
- var link = row.querySelector("td:nth-child(3) > div > a")
- var rarity = link.className
- var name_and_ID = link.href
- var ilvl = row.querySelector("td:nth-child(4)").textContent
- return [name_and_ID, rarity, ilvl]
- }
- function to_json(list) {
- return console.log(JSON.stringify(list))
- }
Add Comment
Please, Sign In to add comment