A workaround for disposing HTML by diving into js source code

I recently learned about jSoup and would like to dive into it more. However, I ran into obstacles while processing web pages with javascript (I have no knowledge in js, but: /).

I have read that htmlunit would be the right tool to perform web browser actions, but I realized that I don't need to know in js if I can find out the JSON Object received in the web page using javascript.

For example, this page : among the source files, one of them is tooltips.js. In this file, the rgNeededFeeds variable is generated and called in the LoadHeropediaData () method, which is the method to generate the entire URL link to get the json object.

URL = URL + 'jsfeed/heropediadata?feeds='+strFeeds+'&v=3633666222511362823&l=english';

      

I couldn't figure out what strFeeds really is. I've tried various combinations, but it doesn't work (it returned an empty array ...). Or, is my guess turned off completely?

What I actually want is the data that it displays at the top when you click on one of the "items". Hanging information will do the same, but it lacks recepi information. And my guess is that by getting the json object from the full url above, well, basically all data data should be in that json.

Anyway, this is only based on what I understand by looking at these source files for hours. Correct me if I am wrong. Thank! (i am in java btw)

** p / s: I would also like to take this opportunity to express my gratitude to Baluska, he was all over the place when I have doubts about jSoup .:> *

+3


source to share


1 answer


strFeeds

- is nothing more than one of these two lines: itemdata

orabilitydata

You can find this at tooltips.js

at line 38-45

var rgNeededFeeds = [];
$.each( [ 'item', 'ability' ], 
function( i, ttType ){
        icons = GetIconCollection( ttType );
        if ( icons.length ){
            rgNeededFeeds.push( ttType+'data' );
                 //..............
            }
     }
)    

      

ttType

is the value of iterating over the array [ 'item', 'ability' ]

, which is concatenated with the string data

, inserted into the arrayrgNeededFeeds



The function LoadHeropediaData

is called at the end of the above function with rgNeededFeeds

as a parameter:

LoadHeropediaData( rgNeededFeeds );

      

Plus: if you start cleaning up websites, learning javascript is MANDATORY.

NOTE: you are correct, JSON contains all the information you need ...

+1


source







All Articles