k12k08 Posted June 5, 2012 Posted June 5, 2012 (edited) Hello fellow reader, I am fresh to autoit and have minor programming experience so I would highly appreciate the community's help. There is this website where we are allowed to print the pages but only 10 at a time, which I need over 1,500 pages in total so manual editing the page's url 150 times would be very tedious and not fun. Here is what I have so far which does not work: $i = 1 $z = 10 Local $printdefault = InetGet("http:/examplesite.com&id=230/" & $i & "&__pagestoprint=" & $z DO Sleep(250) $i = $i + 10 $z = $z + 10 Until $i > 30 Func _Exit() Exit EndFunc ;==>_Exit This probably looks like a work of a child so please bare with me lol, let give you guys some more insight, the full page url is: " http:/examplesite.com&id=230/1&__pagestoprint=10 ", from 1 and 10 I can change the numbers from the url to print what ever pages I want as long as if the pages does not exceed over 10. I also want it to stop at the number it is designated to it, example stop at page 456. I would really appreciate your guys time and effort on this! Thank you in advance. If I missed out any detail or anything please let me know, I will respond ASAP ! Edited June 5, 2012 by k12k08
k12k08 Posted June 5, 2012 Author Posted June 5, 2012 Let me know if this is to complex or cant be done so i can start the process manually, which I would not like to do but i"ll result to it.
somdcomputerguy Posted June 5, 2012 Posted June 5, 2012 So this URL - http:/examplesite.com&id=230/1&__pagestoprint=10 would print pages 1 thru 10. Would http:/examplesite.com&id=230/11&__pagestoprint=10 print pages 11 thru 21? Then http:/examplesite.com&id=230/22&__pagestoprint=10 for the next batch of 10 pages?There is also some errors in your code I believe. The first ampersand in the URL should probably be a question mark. ShellExecute should probably be used instead of InetGet, and that line should be in the Do..Until loop. You're missing the closing parenthesis on that line too. After the http protocol should be ://. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
k12k08 Posted June 5, 2012 Author Posted June 5, 2012 (edited) So this URL - http:/examplesite.com&id=230/1&__pagestoprint=10 would print pages 1 thru 10. Would http:/examplesite.com&id=230/11&__pagestoprint=10 print pages 11 thru 21? Then http:/examplesite.com&id=230/22&__pagestoprint=10 for the next batch of 10 pages?There is also some errors in your code I believe. The first ampersand in the URL should probably be a question mark. ShellExecute should probably be used instead of InetGet, and that line should be in the Do..Until loop. You're missing the closing parenthesis on that line too. After the http protocol should be ://.Thank you soo much!!And yes it ishttp:/examplesite.com&id=230/1&__pagestoprint=10 would print pages 1 thru 10.andhttp:/examplesite.com&id=230/11&__pagestoprint=10 print pages 11 thru 21and Thenhttp:/examplesite.com&id=230/21&__pagestoprint=10 for pages 21 thru 30.andhttp:/examplesite.com&id=230/31&__pagestoprint=10 for pages 31 thru 40.And soo on.Would you be soo kind and fix my code for me, I keep on getting the same error after you corrections Edited June 5, 2012 by k12k08
somdcomputerguy Posted June 5, 2012 Posted June 5, 2012 I'm still kinda confused about this, but does this work the way you need? You should comment out the ShellExecute line, and uncomment the ConsoleWrite line, to see if displays the right line first.$i = 1 $z = 10 Do ;ConsoleWrite("http://examplesite.com?id=230/" & $i & "&__pagestoprint=" & $z & @LF) ShellExecute("http://examplesite.com?id=230/" & $i & "&__pagestoprint=" & $z) Sleep(250) $i += 10 $z += 10 Until $i > 30 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
k12k08 Posted June 5, 2012 Author Posted June 5, 2012 gosh, thank you so much for your time and effort you helped me on this project, going to save me alot of time ! take care man
somdcomputerguy Posted June 5, 2012 Posted June 5, 2012 You bet. I'm glad it works for you. Do yourself a solid; read thru the Help file (especially the Language Reference section), and learn and understand why the code works the way it does (specifically I mean the Do..Until loop). Compare my code with your code, you'll see there are some differences, but they're real similar to each other. Good Luck! - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Bert Posted June 5, 2012 Posted June 5, 2012 Question - can you capture the HTML from the page or is the rendered page a PDF? If it is HTML would it not be simply faster to get the code and put it all into one file you can keep locally? You wouldn't need to kill a tree to view the documentation. The Vollatran project My blog: http://www.vollysinterestingshit.com/
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now