# program for moving through numbered html pages



## doomgiver (Apr 5, 2012)

i want to browse through a site which contains pages ordered in ascending secquence.

like :

/www.page.com/page/1
/www.page.com/page/2
/www.page.com/page/3
...
so on automatically, with a short, changable delay.

i think this can be done somehow in javascript/python, but i dont know how.
can someone help me here?


----------



## Liverpool_fan (Apr 6, 2012)

Moving through? You mean what? Indexing? Downloading? What?


----------



## krishnandu.sarkar (Apr 6, 2012)

By any chances you mean Navigation System like these threads have..??

First, Previous, 1, 2, 3, Next, Last


----------



## doomgiver (Apr 6, 2012)

yeah, something like KS said.

i just want to browse.

lots of image sites have their images indexed in folders. i want to navigate one by one (at keypress or at a pre-determined time) through them.


----------



## krish_puri (Apr 6, 2012)

PM me the site, I'll quickly build it for you!


----------



## Niilesh (Apr 6, 2012)

Does the site has some index kind of page?
If yes simply download level1 links. Though it will download more than needed
You can also download "/www.page.com/page/*" (if it only points to needed files)


----------



## nims11 (Apr 6, 2012)

easily through javascript.


----------



## doomgiver (Apr 6, 2012)

i donot need to download.
like im on /page/1
and press a key, then i get taken to /page/2 ... so on, like in online manga readers.

and yeah, the site is indexed.

"*tf2b.com/"
the numbers go into the field at top left.

example with number :
"*tf2b.com/?id=76561197990263447"

krish_puri made a spiffing good program, in a damn short time too!
it takes a starting id, 76561197990263447, in this case, number of attempts or range, and time to stay on the page.

it works great!!

it goes through each id, just as i wanted. 
but its slightly slow to load the pages on ym system(old laptop) i think it uses chrome engine. if only it could be made to use the opera engine, it'd blaze through!!!

and a java script alternative, if its possible would be awesome too.


----------



## RCuber (Apr 6, 2012)

you can use Opera's Forward button to go to next page.


----------



## doomgiver (Apr 6, 2012)

^^ does not work.
keep in mind that im not going back and forth in history, i want to go to the next backpack id.

in short, i want to view all backpacks one by one.
try these :
"*tf2b.com/?id=76561197990263447"
76561197990263448
76561197990263449
76561197990263450

this is what i meant by going thru backpacks one by one.


----------



## ico (Apr 6, 2012)

lol tf2 backpack


----------



## doomgiver (Apr 6, 2012)

you know it, 

anyway, the rest of the sites dont have what i want to do.


----------



## nbaztec (Apr 6, 2012)

Easy as a pie, but wait a caveat - If you visit that site you will not have any control on the JS. Enter <iframe /> 

Use this HTML:


```
<html>
     <head><title>Foo::Bar</title></head>
     <body>
    	<iframe id="preview" src="" width="800" height="600"></iframe>
       	<script type="text/javascript">
			var base_addr = "*tf2b.com/?id=";
			var num_str = "76561197990";
			var num_int = 263447;
			var increment = 1;
			var delay = 1000;
			var preview = document.getElementById("preview");
			setInterval(function(){		
				preview.src = base_addr + num_str + num_int;
				num_int += increment;
			},delay);
		</script>
    </body>
</html>
```

Change the code in vars accordingly:
base_addr : Site root address
num_str  : In case the number is too big to JS split it in a static string part and integer part
num_int  : The incremental part of number
increment: The increment factor
delay : Delay in milliseconds


----------



## doomgiver (Apr 6, 2012)

aww sweet!!!
just what i needed!!!

hmm, now it needs just one thing.
how to pause or stop it when i want?

i donot wish to kill the tab, i want to just pause it, or, better, have it output the id when i last pressed the stop button/keystroke.

ok, cool, i understand what you did with splitting the numbers into 2. that makes it pretty simple.


----------



## nbaztec (Apr 6, 2012)

```
<html>
	<head><title>Foo::Bar</title></head>
	<body>
    	<input name="button" id="control" type="button" value="Start" onClick="changeState()"><br>
<iframe id="preview" src="" width="800" height="600"></iframe>
       	<script type="text/javascript">
			var base_addr = "*tf2b.com/?id=";
			var num_str = "76561197990";
			var num_int = 263447;
			var increment = 1;
			var delay = 1000;
			
			var state = false;
			var preview = document.getElementById("preview");
			var id = 0;
			function changeState(){
				state = !state;
				if(state){ doJob(); document.getElementById("control").value = "Stop"; }
				else if(id){ clearInterval(id);	document.getElementById("control").value = "Start"; }			
			}
			function doJob(){
					id = setInterval(function(){		
					preview.src = base_addr + num_str + num_int;
					num_int += increment;
				},delay);
			}
	 </script>
    </body>
</html>
```

More features?


```
<html>
	<head><title>Foo::Bar</title></head>
	<body>
    	<input name="button" id="control" type="button" value="Start" onClick="changeState()">
        <div>Current page: <span id="output" style="color:#039"></span></div><br>
<iframe id="preview" src="" width="800" height="600"></iframe>
       	<script type="text/javascript">
			var base_addr = "*tf2b.com/?id=";
			var num_str = "76561197990";
			var num_int = 263447;
			var increment = 1;
			var delay = 2000;
			
			var state = false;
			var preview = document.getElementById("preview");
			var output = document.getElementById("output");
			var control = document.getElementById("control");			
			var id = 0;
			function changeState(){
				state = !state;
				if(state){ doJob(); control.value = "Stop"; }
				else if(id){ clearInterval(id);	control.value = "Start"; }			
			}
			function doJob(){
					id = setInterval(function(){		
					output.innerText = preview.src = base_addr + num_str + num_int;
					num_int += increment;
				},delay);
			}
		</script>
    </body>
</html>
```


----------

