haydenk Posted September 12, 2012 Report Share Posted September 12, 2012 Im new to Mac Express Pro. I work in sports data. I need to copy/paste from pages linked to this website page. http://tatts.com/racing I need to enter each individual race page (between 10 and 100 each day) - under the 'gallops' section - and copy the page, and paste to excel. I see that there are potentially a number of different options one could use including window controls, capture, keyboard (pressing 'tab' does not seem to work on these webpages.) I have not been able to find enough info on the tutorials etc. What is the most efficient way to achieve this? each page has a different url - eg . http://tatts.com/racing/2012/9/12/BR/1 Is there a way to automate this date/letter/number format? - there are a limited variety which i could ask for each day and if not present could proceed to the next line? Is vba code a possible option? The website offers XML feed, but they don't seem willing/able to assist with my enquiries. Any help will be much appreciated. Quote Link to comment Share on other sites More sharing options...
Cory Posted September 12, 2012 Report Share Posted September 12, 2012 You could do this with VBA. I used to try this with MEP but it became frustrating so instead I wrote a little VBScript that downloads the HTML to a variable for parsing. Works slick.If you want to copy and paste there are others here that could better assist you. I suggest you consider if you really need your destination to be Excel. Mist use it for the ready made grid but most times I write my MEP macros to output to CSV. Saves a lot of headache. Quote Link to comment Share on other sites More sharing options...
Cory Posted September 12, 2012 Report Share Posted September 12, 2012 You could do this with VBA. I used to try this with MEP but it became frustrating so instead I wrote a little VBScript that downloads the HTML to a variable for parsing. Works slick.If you want to copy and paste there are others here that could better assist you. I suggest you consider if you really need your destination to be Excel. Mist use it for the ready made grid but most times I write my MEP macros to output to CSV. Saves a lot of headache. Quote Link to comment Share on other sites More sharing options...
haydenk Posted September 13, 2012 Author Report Share Posted September 13, 2012 Does MEP provide options on the software (i can't find it) to output to CSV? or does this need to written code? Quote Link to comment Share on other sites More sharing options...
Cory Posted September 19, 2012 Report Share Posted September 19, 2012 One has to do it by hand. I create TSV files, with a tab as a delimiter, as I prefer tabs so I can avoid using quotes. I include the snippet below in the beginning of almost all my macros. If outputting one line at a time you only need the tab. I build one complete line at a once and output. Of course if you use commas and you do one line at a time where there's a option to append with CRLF then you don't need these at all. But I often like to avoid multiple writes and build one output variable that I write to file at the end. However I still sometimes write one line at a time for macros like web scrapers that run a long time and there's a possibility of interruption and loss of what's in memory. Variable Set to ASCII Char 9 to %Tab% Variable Set to ASCII Char 10 to %LF% Variable Set to ASCII Char 13 to %CR% Or the cuttable: <VARIABLE SET TO ASCII CHAR Value="9" Destination="%Tab%"/> <VARIABLE SET TO ASCII CHAR Value="10" Destination="%LF%"/> <VARIABLE SET TO ASCII CHAR Value="13" Destination="%CR%"/> BTW another good reason to use TSV format is that you can save the value to the clipboard and paste it into most tabular MS Office apps like Excel with no paste special or other hoops. EG "A1%Tab%B1%CR%%LF%A2%Tab%B2%CR%%LF%" will result in 4 cells arranged in two rows and two columns. Makes it nice and user friendly. Conversely if you copy from the clipboard form Excel you can parse a large table easily into arrays on CRLF and Tabs. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.