Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
A certain site has this script :<script language="JavaScript">
var forumid=3;
var forum_name="Halflife & Counter-Strike";
var Description="זה הזמן להצטרף לשחקני CS הישראלים!";
var sticky_message_text='חשוב: ';
var fstatus=1;
var skin=0;
var page=0;
var hot_topic=25;
var topics=6373;
var topics_per_page=25;
var replys_per_page=15;
var archive=0;
var channel=1;
var karma=11;
var credits=0;
var super_credits=0;
var rank='1';i need my program to get the variable karma and display the value (in this case - 11) how can i do this?

1. Choose a programming language (almost any popular one can do this...Perl, php, C, C++, Java, VisualBasic, etc.
2. open a socket to to site, read in the page
3. Extract the data using a regular expression-SN

Your scraping data from a website. Often called simply webscraping.
Write a program on your web server which runs regularly. Here is how it should go.
1) This program should first open a connection the website to download the file with the information you want.
2) Next, the program searches the file for specific characters like "var rank='1'". You can use regular expressions, which are search queries for characters. You save the specific characters to a variable.
3) Your script writes this variable to a file/database.
4) Another script reads this data from the file/database and writes it to an html (maybe the script is embedded in the html file and dynamically includes the data in the html file before it is sent).
This is a very popular tutorial for web scraping with regular expressions in Python.

I think you are double posting under a different name--like GRAHAM for example--dont try to be smart fartface

"I think you are double posting under a different name"
You're entitled to think what you want. If you intend to make a point about it, you should provide examples.

![]() |
call unix commands throug...
|
changing ie's footer via ...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |