How can I get the contents of a table in a confluence page using REST API?
I was able to get the content of the page. But I just want the contents of the table as a list. Any pointers will be appreciated.
Yea there is no direct way to get just the table. You have to get all the content and then parse it yourself to get only the table. I am not sure what programming language you are using for this but for python one good library for this is called BeautifulSoup (https://www.crummy.com/software/BeautifulSoup/bs4/doc/).
There are similar libraries like this for other languages so I would look for one in your language and use it to parse the content.
This relates to the following Confluence Server Page:
This page contains examples of using the Confluence Content REST API using
curl. The responses are piped into
python -mjson.tool (JSON encoder / decoder) to make them easier to read.
you can use the following macro: https://v-and-b.atlassian.net/wiki/spaces/PD/pages/1127186433/Table+Scraper+from+URL+Macro
Here are step-by-step instructions: https://v-and-b.atlassian.net/wiki/spaces/PD/blog/2020/05/26/1142554679/How+to+Display+a+HTML+Table+from+a+URL+as+a+Confluence+Table
hey @George Ivanov
I have a page that has similar url as yours https://v-and-b.atlassian.net/wiki/spaces/PD/pages/1127186433/Table+Scraper+from+URL+Macro, do you know what would be the url, if I want to extract content from that page? I often see people have urls that contain "rest/api/content" which I don't have. Thanks
Feeling overwhelmed by the demands of work and life? With a 25% increase in the prevalence of anxiety and depression worldwide during the pandemic, for most of us, it’s a resounding yes . 🙋♀️ ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events