Incogneat0
New Member
- Joined
- Sep 11, 2014
- Messages
- 3
Beginner here with VBA, and absolute newbie on scraping html data. I am looking to scrape the 2nd html table for player projections from Yahoo fantasy football, but these projections are broken into 17 weeks and only 25 entries per page. The url looks like this
Where S_PW_x indicates the week, and count=x indicates the starting row. count=x needs to add 25 each time for the next page to to be shown. Ideally, I would scrape until count=300
Each week would be placed on a separate tab, with the projections 1 to 300, so I know a nested loop would be needed where a new worksheet would be created, then the table scraped and placed in the first blank row in a loop until count=300, and then this done 17 times for S_PW_1 to 17
I have been browsing the forums for the better part of today and trying to piece together a code to do this, but am ultimately confusing myself more than clarifying. But I know you all like a challenge. To make it tougher, the league I am is password protected, so accessing the link is going to be impossible unless I give the info to my account. Which I will do in a PM, but not openly.
I know this can be done, and most likely easily by someone who knows VBA much better than myself.
Thanks for reading!!
Code:
http://football.fantasysports.yahoo.com/f1/9449/players?status=ALL&pos=ALL&cut_type=9&stat1=S_PW_1&myteam=0&sort=PTS&sdir=1&count=0
Where S_PW_x indicates the week, and count=x indicates the starting row. count=x needs to add 25 each time for the next page to to be shown. Ideally, I would scrape until count=300
Each week would be placed on a separate tab, with the projections 1 to 300, so I know a nested loop would be needed where a new worksheet would be created, then the table scraped and placed in the first blank row in a loop until count=300, and then this done 17 times for S_PW_1 to 17
I have been browsing the forums for the better part of today and trying to piece together a code to do this, but am ultimately confusing myself more than clarifying. But I know you all like a challenge. To make it tougher, the league I am is password protected, so accessing the link is going to be impossible unless I give the info to my account. Which I will do in a PM, but not openly.
I know this can be done, and most likely easily by someone who knows VBA much better than myself.
Thanks for reading!!