• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to deal with alphabetical pagination while creating script

shahin

Active Member
So far, while working with web-scraping I found integers for pagination to increase or go on to the next page. Such as:

Los%20Angeles%2C%20CA&page=1
Los%20Angeles%2C%20CA&page=2
Los%20Angeles%2C%20CA&page=3

And i handled that using for loop like below:

for x = 1 to 3
-----code------
next x


However, today i stumbled across alphabetical pagination and couldn't get any idea to increment it from A to B and so on. Example:

browse-business-directory/char:A
browse-business-directory/char:B
browse-business-directory/char:C
 
The Ascii code for "A" is 65 and for "a" is 97
so you could use that

for x = 65 to 90
-----code-----
next x

use chr(x) to append the character eg:

for x = 65 to 90
myvar = "browse-business-directory/char:"+chr(x)
next x
 
Thanks Sir Hui and Marc L, for such an wonderful solution. I was just thinking about "char" in excel cause i was never familiar with "chr" in vba until now.
 
Back
Top