New Member
April 7, 2023
This is my first question to the group so be kind.
I have developed a power query to Yahoo Finance that extracts every table from the summary & statistics pages and places it into one table. really slick use of that turning a web query into a function and the function reads the input from each address in the table. the issue is that when i come to the financial pages, they are only html documents. so i created same function but i used the xpath addresses. it works but .... one of the companies is behind in its reporting. thus each company has the same number of rows ... cash, equity, revenue. but this one has less columns because it is behind two quarters.
https://finance.yahoo.com/quot.....?p=MPXOF 1-quarterly column and 1 trailing 12 month column
https://finance.yahoo.com/quot.....s?p=EOSE 4-quarterly columns and 1 trailing 12 month column
thus, when i compare the xpath, i get this difference
EOSE | MPXOF | |
TRUE | html[1] | html[1] |
TRUE | body[1] | body[1] |
TRUE | div[1] | div[1] |
TRUE | div[1] | div[1] |
TRUE | div[1] | div[1] |
TRUE | div[1] | div[1] |
TRUE | div[1] | div[1] |
TRUE | div[3] | div[3] |
TRUE | div[1] | div[1] |
TRUE | div[1] | div[1] |
TRUE | div[2] | div[2] |
FALSE | div[1] | |
FALSE | div[1] | |
TRUE | section[1] | section[1] |
TRUE | div[3] | div[3] |
TRUE | div[1] | div[1] |
TRUE | div[1] | div[1] |
TRUE | div[1] | div[1] |
TRUE | div[1] | div[1] |
TRUE | div[2] | div[2] |
TRUE | span[1] | span[1] |
thus, a query using the 5 columned table for MPXOF comes back with an error and the query only keeps everything up to MPXOF. There are only two levels separating the two so can you say in the function if no error use xpath1 and there is an error use xpath2?
thanks;
Doug Marcus
1 Guest(s)