Disclaimer: Data and text in websites is protected by copyright unless specified otherwise. Use this guide only under the fair use limitations in your country.
A question that I often receive when I talk about my spreadsheets is how do I get data directly into Google docs, so I\’ve put together this tutorial on how to get Romanian stock prices. We\’re going to use Tradeville\’s website to do that. As usual, the published data is delayed, but it\’s good enough for end of day tracking.
1. Identify the data you need
From the homepage, you can use the search box in the upper-right corner to search for a ticker symbol (e.g. BRD). This will get you to a page like the one below. In that page, identify the URL (in the address bar of your browser) and the price.![Picture](https://strainu.ro/site/wp-content/uploads/tradeville_gdocs_1.png)
2. Get the data
Now, you need a bit of tech knowledge: you need to open the developer tools in your browser. Fear not, in most browser you can use the Ctrl+Shift+I key combination (Cmd+Shift+I on Mac) to open it. You can see how that looks like in Firefox in the picture below. Click the little arrow in the top-left corner (in red towards the middle of the picture), then select the element that contains the price. In the code pane, the equivalent line of code is selected (the red highlight at the bottom of the picture 2).![](https://strainu.ro/site/wp-content/uploads/tradeville_gdocs_2.png)
![](https://strainu.ro/site/wp-content/uploads/tradeville_gdocs_3.png)
3. Use the data in Google docs
Not that you have the path, you can use the information you got above (the URL of the page and the XPath of the element containing the price) in the IMPORTXML function in Google Spreadsheets. Just put in any cell the following function call: =IMPORTXML("https://www.tradeville.eu/actiuni/actiuni-BRD";"/html/body/form/div[2]/div[2]/div[3]/div[1]/div[4]/div/div[1]/div[2]") Let\’s see how that looks:![](https://strainu.ro/site/wp-content/uploads/tradeville_gdocs_4.png)
Lasă un răspuns