I have the following html code:


And on and on.....

I am looking for a code that extracts the value from <tag></tag> and puts them into variable.

I don't want to use HTML Agility Pack, don't ask why.Also XML is not an option for me.

I hope you understand what i am looking for. If you have further question, ask.

You can use jQuery for pulling data. It's fairly simple.

Here's an example using your code.


name = $("name").text();
kills = $("kills").text();
ach_count = $("ach_count").text();


The alerts are just to show that the data is being pulled.

If you've never used jQuery before, you need to download the jQuery library or include them from the google hosted server into the head tags of your page. Here's the libraries that you can include from Google.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>

Hope this helps.

This question has already been answered. Start a new discussion instead.