DavChana
DavChana

Reputation: 1966

How to fetch text from single cell excel sheet published on Microsoft OneDrive?

Below link displays a single cell value (1,250.21) from a Microsoft Excel sheet hosted at my OneDrive:

https://onedrive.live.com/embed?cid=1675CEC70987A1BC&resid=1675CEC70987A1BC%217430&authkey=ADt10TUFiPzFu90&em=2&wdAllowInteractivity=False&Item=%27AC-QR%27!K1&wdHideGridlines=True

or

http://goo.gl/FXbaMF

Now, I tries fetching this URL via standard cUrl, but got a lot of JavaScript & standard HTML only, nowhere on the whole page there was this value mentioned.

Is there any way to fetch this value(1,250.21)?

Upvotes: 0

Views: 432

Answers (1)

William J.
William J.

Reputation: 1584

Fetching this URL using cURL gives a different result from getting it through the browser, maybe the site checks for some cookie , session variable or even the user agent to determine if it's an automated request. Maybe you'll have to add some extra param to your cURL request in order to get the whole document. Take a look at curl_setopt

Once you've done that, you'll simply have to parse the document and find this element:

I guess you'll have to parse the HTML fetched by cURL and look for this element which holds the value you want:

<div originalhorizontalalignment="3" class="cv-nwr" style="width:66px;max-height:16px;text-align:right;font:bold 10pt Calibri,'Segoe UI',Thonburi,Arial,Verdana,Sans-Serif;" title="1,250.21">1,250.21</div>

Upvotes: 1

Related Questions