Login Search

Excel based tutorial for web scraping

Last Post
#273

Default

I was a bit sloppy when writing the first response. The formula should have been:
IF(AND(K3="Home",M3="W"),"W","")

i.e. just change the "L" to "" or 0 or whatever you want it to be.

I don't have time to write the VBA for it but maybe someone else has.

Quote Originally Posted by oilcountry99 View Post
I gave this a shot and the problem is, for example under the Home Wins column:

I end up getting an L if the game is a Home Loss or a Road game. How would I eliminate the "Road" results from the "Home Wins" column?

Under the "Home Wins" column I should have a blank or a "0" as a place holder for road results.
#274

Default

Quote Originally Posted by akphidelt View Post
Awesome thread guys. Hope I can help. Expert in excel. Also produced web programs, was on another site with an NBA tracker. Have it on www.akptracker.com. Can scrape any data off any site.

B_rad, I promise you if you took the time to do this through php and MySQL you would never use excel again. And it's completely free to do. Just download Xampp from apachefriends.org. Either way, hope I can help. Love this stuff.

Akphidelt would like to speak more with you in regards to the work you have done - I dont have private message capabilities yet so I can give email if you are interested. Thanks
#277

Default

b_rad_1983,

How are you importing it?

If you are using VBA then the amount of data should not matter if coded properly. However, it can take some tweaking.

If you are using formulas or queries, then it is pretty easy to overwhelm Excel so that it hangs and the way around that is to use VBA.
#280

Default

here is my basic import layout


For gameday = 63274 To 63849


Sheets("Temp").Select
With Sheets("Temp").QueryTables.Add(Connection:= _
"URL;http://www.covers.com/pageLoader/pageLoader.aspx?page=/data/nhl/results/2014-2015/boxscore" & gameday & ".html", Destination:= _
Range("$A$1"))
.Name = test
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingrts
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = True
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
#285

Default

Quote Originally Posted by b_rad_1983 View Post
Bsims, do you have a project on the go?
After several years on the sidelines, I've decided to enter the analytical fray again. The first step is to review past efforts and decide which ones show enough promise to take another look at. This is non trivial, because I have over a decade and thousands of hours of work to go through.